summaryrefslogtreecommitdiff
path: root/ale_linters/c
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/c')
-rw-r--r--ale_linters/c/gcc.vim10
1 files changed, 7 insertions, 3 deletions
diff --git a/ale_linters/c/gcc.vim b/ale_linters/c/gcc.vim
index 3c18964a..583f4fab 100644
--- a/ale_linters/c/gcc.vim
+++ b/ale_linters/c/gcc.vim
@@ -9,12 +9,16 @@ if !exists('g:ale_c_gcc_options')
let g:ale_c_gcc_options = '-std=c11 -Wall'
endif
+function! ale_linters#c#gcc#GetCommand(buffer) abort
+ return 'gcc -S -x c++ -fsyntax-only '
+ \ . g:ale_c_gcc_options . ' -'
+
+endfunction
+
call ale#linter#Define('c', {
\ 'name': 'gcc',
\ 'output_stream': 'stderr',
\ 'executable': 'gcc',
-\ 'command': 'gcc -S -x c -fsyntax-only '
-\ . g:ale_c_gcc_options
-\ . ' -',
+\ 'command_callback': 'ale_linters#c#gcc#GetCommand',
\ 'callback': 'ale#handlers#HandleGCCFormat',
\})