ale/ale_linters/c/gcc.vim

25 lines
698 B
VimL
Raw Normal View History

2016-10-03 14:55:55 -04:00
" Author: w0rp <devw0rp@gmail.com>
" Description: gcc linter for c files
" Set this option to change the GCC options for warnings for C.
if !exists('g:ale_c_gcc_options')
2016-10-21 10:02:20 -04:00
" let g:ale_c_gcc_options = '-Wall'
" let g:ale_c_gcc_options = '-std=c99 -Wall'
" c11 compatible
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_callback': 'ale_linters#c#gcc#GetCommand',
2016-10-03 08:18:27 -04:00
\ 'callback': 'ale#handlers#HandleGCCFormat',
\})