11" vim compiler file
22" Compiler: cppcheck (C++ static checker)
33" Maintainer: Vincent B. ([email protected] )4- " Last Change: 2024 Nov 19 by @Konfekt
4+ " Last Change: 2025 Nov 06 by @Konfekt
55
66if exists (" current_compiler" ) | finish | endif
77let current_compiler = " cppcheck"
@@ -18,14 +18,14 @@ if !exists('g:c_cppcheck_params')
1818 let s: undo_compiler = ' unlet! g:c_cppcheck_params'
1919endif
2020
21- let & l: makeprg = ' cppcheck --quiet'
21+ exe ' CompilerSet makeprg= ' .. escape ( ' cppcheck --quiet'
2222 \ ..' --template="{file}:{line}:{column}: {severity}: [{id}] {message} {callstack}"'
2323 \ ..' ' ..get (b: , ' c_cppcheck_params' , get (g: , ' c_cppcheck_params' , (&filetype == # ' cpp' ? ' --language=c++' : ' ' )))
2424 \ ..' ' ..get (b: , ' c_cppcheck_includes' , get (g: , ' c_cppcheck_includes' ,
2525 \ (filereadable (' compile_commands.json' ) ? ' --project=compile_commands.json' :
2626 \ (! empty (glob (' *' ..s: slash ..' compile_commands.json' , 1 , 1 )) ? ' --project=' ..glob (' *' ..s: slash ..' compile_commands.json' , 1 , 1 )[0 ] :
27- \ (empty (&path ) ? ' ' : ' -I' )..join (map (filter (split (&path , ' ,' ), ' isdirectory(v:val)' ),' shellescape(v:val)' ), ' -I' )))))
28- exe ' CompilerSet makeprg= ' .. escape (& l: makeprg , ' \|"' )
27+ \ (empty (&path ) ? ' ' : ' -I' )..join (map (filter (split (&path , ' ,' ), ' isdirectory(v:val)' ),' shellescape(v:val)' ), ' -I' ))))),
28+ \ ' \|"' )
2929
3030CompilerSet errorformat =
3131 \% f :% l: % c :\ % tarning: \ % m ,
0 commit comments