News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Cppcheck settings?

Started by Krice, June 19, 2025, 12:44:10 PM

Previous topic - Next topic

Krice

When I run cppcheck (on latest Code::Blocks) it's reporting warnings about invalid C code (using classes...) but at the same time it's also reporting all typical C++ warnings. The class warning tells to "Use --std, -x or --language to enforce C++." How do you add those flags for cppcheck? It's kind of annoying to get those extra warnings for each class. Also, is there a way to read .xml output in human readable format?

Miguel Gimenez

#1
I used it with C::B and did not need command line switches; it will default to the last version of C or C++.

Anyway, cppcheck usage is OT here; you can ask in their forum.

EDIT:

Quoteis there a way to read .xml output in human readable format?

Are you using the GUI?

blauzahn

You can add these flags in settings|environment|CppCheck/Vera++|CppCheck arguments. So, if you have a c++ project e.g.:

--verbose --enable=all --xml --language=c++ --std=c++20


If you do not need cross-translation checks, then the option -j 8 can use multiple cores to speed things up significantly.

The messages should show up readable in the CppCheck/Vera++ messages log panel.


Krice

Quote from: blauzahn on June 19, 2025, 08:19:35 PM
You can add these flags in settings|environment|CppCheck/Vera++|CppCheck arguments.

Right, the settings were there.. I tried to find it from Editor settings. Thanks, now it works.