User forums > Help

Cppcheck settings?

(1/1)

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:
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:


--- Quote ---is there a way to read .xml output in human readable format?
--- End quote ---

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.:

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

--- End code ---

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.
--- End quote ---

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

Navigation

[0] Message Index

Go to full version