added possibility to check header files
This commit is contained in:
parent
2aae51681b
commit
4dbe8baf4d
@ -19,13 +19,17 @@ if !executable("gcc")
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_c_GetLocList()
|
||||
" only check c files
|
||||
if expand('%') =~ '.h$'
|
||||
return []
|
||||
endif
|
||||
let makeprg = 'gcc -fsyntax-only %'
|
||||
let errorformat = '%-G%f:%s:,%f:%l: %m'
|
||||
|
||||
if expand('%') =~ '.h$'
|
||||
if exists('g:syntastic_c_check_header')
|
||||
let makeprg = 'gcc -c %'
|
||||
else
|
||||
return []
|
||||
endif
|
||||
endif
|
||||
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user