I don't want to use cppcheck on the file where UTLGEN_TO_STR is defined.
For this reason I suppressed unknownMacro.
The problem is that the generated dump files where there is this line of code #define BFLRLY_VERSION_STRING (UTLGEN_TO_STR(MAJOR_VER) UTLGEN_TO_STR(MINOR_VER))
are incorrect and cppcheck no longer works.
Is there an option in cppcheck to avoid having this problem?
Is there a rule to prevent malformed dumps from being created due to the presence of unknownMacro?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
An extra -D__cppcheck__ would still be needed for this.
If there are unknownMacro warnings then cppcheck must abort there must be code that we cannot parse well. In general unknown macros do not result in unknownMacro warnings and aborted analysis.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
when I concatenate two unknown macros cppcheck doesn't work anymore and if there are errors in the C file they are not found.
Example macro:
Where "UTLGEN_TO_STR" is a unknown macro.
When call cppcheck i suppress unknownMacro .
Do you have an idea about a possible solution?
Best Regards,
Alessandro
Hi,
do you have any update to fix this problem?
Best Regards,
Alessandro
You can pass
-DUTLGEN_TO_STR=...
to cppcheck to define a macro. Or maybe make the header thatUTLGEN_TO_STR
resides in visible to cppcheck?I don't want to use cppcheck on the file where
UTLGEN_TO_STR
is defined.For this reason I suppressed unknownMacro.
The problem is that the generated dump files where there is this line of code
#define BFLRLY_VERSION_STRING (UTLGEN_TO_STR(MAJOR_VER) UTLGEN_TO_STR(MINOR_VER))
are incorrect and cppcheck no longer works.
Is there an option in cppcheck to avoid having this problem?
Is there a rule to prevent malformed dumps from being created due to the presence of unknownMacro?
Hi,
Could you please let me know if there are any updates on this ticket?
Thanks a lot!
Alessandro
I would suggest you follow advice by chr. Define UTL_GEN_STR in some way.
If you don't want to include the header and you don't want to use -D then how about something like:
An extra -D__cppcheck__ would still be needed for this.
If there are unknownMacro warnings then cppcheck must abort there must be code that we cannot parse well. In general unknown macros do not result in unknownMacro warnings and aborted analysis.