From 4dbe8baf4d2a0cdea0fabebf5a7e5387c03e72fd Mon Sep 17 00:00:00 2001 From: kongo2002 Date: Mon, 21 Dec 2009 02:19:53 +0800 Subject: [PATCH] added possibility to check header files --- syntax_checkers/c.vim | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/syntax_checkers/c.vim b/syntax_checkers/c.vim index 6b3eb28d..ad834fba 100644 --- a/syntax_checkers/c.vim +++ b/syntax_checkers/c.vim @@ -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