Hi I created up an .cppcheck xml from my setup using a script .
I activated CERT , MISRA analysis, and use CPPCheck GUI
I was surprised there's wasn't so much entries in the report : too good to be true.
Then, I tried to use Analyze/directory... from the GUI and I get a LOT more entries !
And most cannot be related to defines...
It's seems really strange to me 🤨
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi I have the feeling it's linked to an #ifdef block that have a syntax error. In this case could it stop the processing of the remaining part of the file ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
if you get some syntax error output then yes this will stop all the analysis immediately.
if you don't get the output then it shouldn't stop.
I assume that when you provide include paths and defines then you get a lot fewer warnings. If you use -E (cppcheck -E -DDEF file.c) option on a file can you see if the preprocessor output contains some important parts of your code?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi I created up an .cppcheck xml from my setup using a script .
I activated CERT , MISRA analysis, and use CPPCheck GUI
I was surprised there's wasn't so much entries in the report : too good to be true.
Then, I tried to use Analyze/directory... from the GUI and I get a LOT more entries !
And most cannot be related to defines...
It's seems really strange to me 🤨
yes it sounds strange. hard to say what the reason is.
can you reproduce the behavior for a single file also? Using Analyze/file.. and then the .cppcheck can specify a file instead of a path to check.
if you create a .cppcheck file that does not have any defines then the analysis should be similar to Analyze/directory..
can you show the .cppcheck file?
Hi I have the feeling it's linked to an #ifdef block that have a syntax error. In this case could it stop the processing of the remaining part of the file ?
if you get some syntax error output then yes this will stop all the analysis immediately.
if you don't get the output then it shouldn't stop.
I assume that when you provide include paths and defines then you get a lot fewer warnings. If you use
-E
(cppcheck -E -DDEF file.c) option on a file can you see if the preprocessor output contains some important parts of your code?