I have one issue with cppcheck during enable it in VIM, for normal code it works fine but normally I have
typedef and some functions which may not known by cppcheck. For individual check, I have no problem because I can write library and rules for cppcheck, for example
<!-- 2015-Oct-23 requested by Chen How -->
<podtype name="Int8" sign="s" size="1"/>
<podtype name="UInt8" sign="u" size="1"/>
<podtype name="Int16" sign="s" size="2"/>
<podtype name="UInt16" sign="u" size="2"/>
<podtype name="Int32" sign="s" size="4"/>
<podtype name="UInt32" sign="u" size="4"/>
When I use cppcheck, I do following command:
$ cppcheck --library=mycppcheck.cfg
My question is: when I use cppcheck in VIM, how can I tell cppcheck, for current file, which library it should use? without library, cppcheck can't identify correct risk.
syntastic as the plug-in for VIM, or any other way to enbale cppcheck facility without this plug-in?
I also checked the topic Vim & CppCheck, which errorformat to use:, I think it can work for me but I did not find the library define in this. Regarding above topic, my first guess is changing:
set makeprg=cppcheck\ --enable=all\ %
set makeprg=cppcheck\ --library=mycppcheck.cfg --enable=all\ %
More findings @
4.8. Q. How can I pass additional arguments to a checker?
A. Almost all syntax checkers use the makeprgBuild() function. Those checkers that do can be configured using global variables. The general form of the global args variables is syntastic___args.
So, If you wanted to pass --my --args --here to the ruby mri checker you would add this line to your vimrc:
let g:syntastic_ruby_mri_args = "--my --args --here"
See :help syntastic-checker-options for more information.