c/c++: force language in compiler invocation.

That way, the files are properly treated as C/C++ even when they don't
have the standard file extension

Signed-off-by: Florent Bruneau <florent.bruneau@intersec.com>
This commit is contained in:
Florent Bruneau 2012-12-16 17:01:31 +01:00
parent 4b0b81cddc
commit 29d5b88e27
2 changed files with 2 additions and 2 deletions

View File

@ -89,7 +89,7 @@ if !exists('g:syntastic_c_config_file')
endif
function! SyntaxCheckers_c_GetLocList()
let makeprg = g:syntastic_c_checker . ' -fsyntax-only '
let makeprg = g:syntastic_c_checker . ' -x c -fsyntax-only '
let errorformat = '%-G%f:%s:,%-G%f:%l: %#error: %#(Each undeclared '.
\ 'identifier is reported only%.%#,%-G%f:%l: %#error: %#for '.
\ 'each function it appears%.%#,%-GIn file included%.%#,'.

View File

@ -92,7 +92,7 @@ if !exists('g:syntastic_cpp_config_file')
endif
function! SyntaxCheckers_cpp_GetLocList()
let makeprg = g:syntastic_cpp_compiler . ' -fsyntax-only ' .
let makeprg = g:syntastic_cpp_compiler . ' -x c++ -fsyntax-only ' .
\ g:syntastic_cpp_compiler_options
let errorformat = '%-G%f:%s:,%f:%l:%c: %trror: %m,%f:%l:%c: %tarning: '.
\ '%m,%f:%l:%c: %m,%f:%l: %trror: %m,%f:%l: %tarning: %m,'.