I have a folder in which there are several .c
and .h
files, plus a message.xml
file.
I don't want to scan the XML.
If I run cppcheck --enable=all *.*
it finds and balks at the contents of the XML.
Fine, I don't care about the XML, but still. I hate seeing ignorable errors/warnings.
Of course, cppcheck *.c --enable=all
or cppcheck *.c *.h --enable=all
ignores the XML.
But curiosity got to me and I found out about the "ignore" switch but its use is unclear. If I try
cppcheck *.* --enable=all -imessage.xml
or various perturbations of that line, it still finds the XML and complains.
So what is the command syntax to ignore a specific file and to ignore, say, all *.xml or *.xls files?
I am a Cppcheck developer.
I guess it's a bug in Cppcheck. As far as I see in the help output you should be able to use -imessage.xml
.
But I would suggest cppcheck . --enable=all
. You don't normally compile headers directly and therefore you shouldn't analyze them directly neither. You get wrong handling of the include guard and you probably get false positives about unused struct members.. well there can be some wrong behavior and don't blame cppcheck.