Robert Zickler - 2023-09-28

If I run with --cppcheck-build-dir (as well as -j 1 also tried with -j n) I noticed the following:

In the first run on the whole project the MISRA-rules
* 2.3 A project should not contain unused type declarations
* 2.4 A project should not contain unused tag declarations
* 2.5 A project should not contain unused macro declarations
* 5.6 A typedef name shall be a unique identifier
* 5.7 A tag name shall be a unique identifier
* 8.5 An external object or function shall be declared once in one and only one file
* 8.7 Functions and objects should not be defined with external linkage if they are referenced in only one translation unit
get detected correctly. Without changing the source files the rules are not listed anymore in the second and following runs. All other rules stay exactly the same.

I'm running on Windows from a batch file. Python 3.11, Cppcheck 2.11. I even tried with the newest ./addons/ folder. All required includes are supplied. Running without python in %PATH%.

My full command line is like

cppcheck.exe --addon-python=%pathToPythonExe% --report-progress %preDefines% --enable=all --xml --language=c --std=c99 --max-ctu-depth=5 -j 1 --platform=%platformFile% --addon=%misraConfigFile% --rule-file=%ruleFile% --output-file=%errFile% --cppcheck-build-dir=%buildDirPath% --includes-file=%includePathProject% -I %includePathsCompiler% --file-list=%projectSourceFileList%

I'm using the build-dir due to the size of the project. For now, my solution is to run without --cppcheck-build-dir and speed up with -j %NUMBER_OF_PROCESSORS%

 

Last edit: Robert Zickler 2023-10-12