Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I ignore certain file types with cppcheck?

Im using cppcheck to analyze my c++ code. I have some .svg/.png files in my source, which makes cppcheck report a lot of errors of the following type:

fileName1.svg:2: error: Cppcheck: Invalid number of character (() when these macros are defined: ''.

Is there an easy way I can make cppcheck ignore files of a certain type?

like image 738
kent Avatar asked Jul 04 '26 14:07

kent


1 Answers

Normally cppcheck checks only C and C++ files.

However, if you tell cppcheck to check .svg files it will check those. For example:

cppcheck filename1.svg

or

cppcheck *.*

So check your command line and make sure you are not giving cppcheck .svg filenames.

If you have problems, let me see your command line.

like image 196
Daniel Marjamäki Avatar answered Jul 07 '26 03:07

Daniel Marjamäki