summaryrefslogtreecommitdiff
path: root/doc/ale-c.txt
diff options
context:
space:
mode:
authorNicolas Pauss <nicolas.pauss@intersec.com>2022-10-12 00:05:37 +0200
committerGitHub <noreply@github.com>2022-10-12 07:05:37 +0900
commit951a668b1490f0b3dcdcec6b4ebf3f626c0f416f (patch)
tree48eac8f7911b6fcfc1ad47ef02f84416628ccfcd /doc/ale-c.txt
parentf085227504076dff5224cbf10cb1bf83286188a9 (diff)
downloadale-951a668b1490f0b3dcdcec6b4ebf3f626c0f416f.zip
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`.
Diffstat (limited to 'doc/ale-c.txt')
-rw-r--r--doc/ale-c.txt30
1 files changed, 27 insertions, 3 deletions
diff --git a/doc/ale-c.txt b/doc/ale-c.txt
index c71a81de..29933861 100644
--- a/doc/ale-c.txt
+++ b/doc/ale-c.txt
@@ -133,7 +133,30 @@ g:ale_c_cc_options *g:ale_c_cc_options*
Type: |String|
Default: `'-std=c11 -Wall'`
- This variable can be change to modify flags given to the C compiler.
+ This variable can be changed to modify flags given to the C compiler.
+
+
+g:ale_c_cc_use_header_lang_flag *g:ale_c_cc_use_header_lang_flag*
+ *b:ale_c_cc_use_header_lang_flag*
+ Type: |Number|
+ Default: `-1`
+
+ By default, ALE will use `'-x c-header'` instead of `'-x c'` for header files
+ when using Clang.
+
+ This variable can be changed to manually activate or deactivate this flag
+ for header files.
+
+ - When set to `-1`, the default beviour is used, `'-x c-header'` is used with
+ Clang and `'-x c'` is used with other compilers.
+ - When set to `0`, the flag is deactivated, `'-x c'` is always used
+ independently of the compiler.
+ - When set to `1`, the flag is activated, `'-x c-header'` is always used
+ independently of the compiler.
+
+ Gcc does not support `'-x c-header'` when using `'-'` as input filename,
+ which is what ALE does. This why, by default, ALE only uses `'-x c-header'`
+ with Clang.
g:ale_c_cc_header_exts *g:ale_c_cc_header_exts*
@@ -141,10 +164,11 @@ g:ale_c_cc_header_exts *g:ale_c_cc_header_exts*
Type: |List|
Default: `['h']`
- This variable can be change to modify the list of extensions of the files
+ This variable can be changed to modify the list of extensions of the files
considered as header files.
- ALE will use `'-x c-header'` instead of `'-x c'` for header files.
+ This variable is only used when `'-x c-header'` is used instead of `'-x c'`,
+ see |ale_c_cc_use_header_lang_flag|.
===============================================================================