-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cc: use '-x c*-header' for header files for C and C++ linters. #4318
cc: use '-x c*-header' for header files for C and C++ linters. #4318
Conversation
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`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good.
I use g++ as one of my linter in ale_linters
the old method |
this breaks cc as the linter badly, see above. |
Oh sorry about that. I though I have tested it with GCC, but I must have messed my config while testing and only tested with clang. |
looking for a fix, as the workaround will totally ignoring cpp headers. Thanks. |
Fix here: #4334 |
…-analysis#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 dense-analysis#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`.
Fix #4096
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
andg:ale_cpp_cc_header_exts
.