I'd like to detect in the source code when cppcheck is active. Does the cppcheck pre-processor create any symbols that indicate its processing the source code?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, Something like __cppcheck__. Looking for some sort of indication that it is cppcheck processing the file and not the compiler. I would use it to deal with wanting to create some alternate versions of macros that are from a library outside of the code getting checked.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'd like to detect in the source code when cppcheck is active. Does the cppcheck pre-processor create any symbols that indicate its processing the source code?
you mean that we would pre-define
__cppcheck__
or something like that. No Cppcheck does not do that currently.Ok. Thank you for the response.
Yes, Something like
__cppcheck__
. Looking for some sort of indication that it is cppcheck processing the file and not the compiler. I would use it to deal with wanting to create some alternate versions of macros that are from a library outside of the code getting checked.You could add a define to your cppcheck invocation with
-D__cppcheck__
.