Commit Graph

4 Commits

Author SHA1 Message Date
Nicolas Pauss 951a668b14
cc: fix using '-x c*-header' for header files with GCC. (#4334)
Gcc does not support `x c*-header` when using `-` as input filename,
which is what ALE does.

Rework the feature to only use `-x c*-header` flag when using Clang and
not GCC.

The feature is now also controlled with the variable
`g:ale_c_cc_use_header_lang_flag` and
`g:ale_cpp_cc_use_header_lang_flag`.
2022-10-12 07:05:37 +09:00
Nicolas Pauss 78942df284
cc: use '-x c*-header' for header files for C and C++ linters. (#4318)
When linting an header file in C or C++, `-x c-header` or
`-x c++-header` should be used instead of `-x c` or `-x c++`.

Using `-x c` or `-x c++` for headers files can lead to unused variables
and functions marked as static inlined as seen in #4096.

Using `-x c-header` or `-x c++-header` solve these issues.

The list of file extensions that are considered as header files can be
configured with the variables `g:ale_c_cc_header_exts` and
`g:ale_cpp_cc_header_exts`.
2022-09-25 09:02:43 +09:00
w0rp 7d4ce4e6aa
Close #3325 - Apply new formatting where possible 2020-08-28 19:50:36 +01:00
w0rp 2b785688ea
#3299 Merge gcc and clang into a cc linter
Users can easily be confused when they set some options for a C or C++
compiler, and another compiler is run with different options, which
still reports errors. To remedy this, the existing `gcc` and `clang`
linters have been replaced with a `cc` linter that will run either
compiler.

This is a breaking change for ALE v3.0.0.
2020-08-20 01:49:14 +01:00