From 6ce5880b81d1feee712c3b18050448f313e1544f Mon Sep 17 00:00:00 2001 From: kongo2002 Date: Sun, 11 Mar 2012 19:40:53 +0100 Subject: [PATCH] set default C compiler options --- syntax_checkers/c.vim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/syntax_checkers/c.vim b/syntax_checkers/c.vim index 9b645f41..d32c5460 100644 --- a/syntax_checkers/c.vim +++ b/syntax_checkers/c.vim @@ -64,17 +64,19 @@ endif let s:save_cpo = &cpo set cpo&vim +if !exists('g:syntastic_c_compiler_options') + let g:syntastic_c_compiler_options = '-std=gnu99' +endif + function! SyntaxCheckers_c_GetLocList() - let makeprg = 'gcc -fsyntax-only -std=gnu99 ' + let makeprg = 'gcc -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%.%#,'. \ '%-G %#from %f:%l\,,%f:%l:%c: %m,%f:%l: %trror: %m,%f:%l: %m' " add optional user-defined compiler options - if exists('g:syntastic_c_compiler_options') - let makeprg .= g:syntastic_c_compiler_options - endif + let makeprg .= g:syntastic_c_compiler_options let makeprg .= ' '.shellescape(expand('%')). \ ' '.syntastic#c#GetIncludeDirs(0)