Merge pull request #292 from kongo2002/c_errorformat

C/C++ errorformat
This commit is contained in:
Martin Grenfell 2012-07-05 15:46:45 -07:00
commit 7b3b63e6df
2 changed files with 24 additions and 2 deletions

View File

@ -58,6 +58,11 @@
" setting are removed from the result set:
"
" let g:syntastic_c_remove_include_errors = 1
"
" Use the variable 'g:syntastic_c_errorformat' to override the default error
" format:
"
" let g:syntastic_c_errorformat = '%f:%l:%c: %trror: %m'
if exists('loaded_c_syntax_checker')
finish
@ -84,7 +89,13 @@ function! SyntaxCheckers_c_GetLocList()
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%.%#,'.
\ '%-G %#from %f:%l\,,%f:%l:%c: %m,%f:%l: %trror: %m,%f:%l: %m'
\ '%-G %#from %f:%l\,,%f:%l:%c: %trror: %m,%f:%l:%c: '.
\ '%tarning: %m,%f:%l:%c: %m,%f:%l: %trror: %m,'.
\ '%f:%l: %tarning: %m,%f:%l: %m'
if exists('g:syntastic_c_errorformat')
let errorformat = g:syntastic_c_errorformat
endif
" add optional user-defined compiler options
let makeprg .= g:syntastic_c_compiler_options

View File

@ -58,6 +58,11 @@
" g:syntastic_cpp_include_dirs' setting are removed from the result set:
"
" let g:syntastic_cpp_remove_include_errors = 1
"
" Use the variable 'g:syntastic_cpp_errorformat' to override the default error
" format:
"
" let g:syntastic_cpp_errorformat = '%f:%l:%c: %trror: %m'
if exists('loaded_cpp_syntax_checker')
finish
@ -77,7 +82,13 @@ endif
function! SyntaxCheckers_cpp_GetLocList()
let makeprg = 'g++ -fsyntax-only '
let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m'
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,'.
\ '%f:%l: %m'
if exists('g:syntastic_cpp_errorformat')
let errorformat = g:syntastic_cpp_errorformat
endif
if exists('g:syntastic_cpp_compiler_options')
let makeprg .= g:syntastic_cpp_compiler_options