Hi,
We commonly use our own "Crash" function to abort a program as a wrapper around abort(). This is annotated for gcc as
#ifdef __GNUC____attribute__((noreturn))#endif
It seems that cppcheck does not process this. I know that the "noreturn" annotation is available in the library config files, but I was hoping for a way to keep that property within the header file the code itself.
Also the manual chapter "Library configuration" is very brief and incomplete (e.g. there is nothing further about loading after the manual says "They can be loaded as described below"), so I don't know how to tell cppcheck to look for a config file in different locations, or even if this is possible.
Any feedback welcome,
thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
We commonly use our own "Crash" function to abort a program as a wrapper around abort(). This is annotated for gcc as
It seems that cppcheck does not process this. I know that the "noreturn" annotation is available in the library config files, but I was hoping for a way to keep that property within the header file the code itself.
Also the manual chapter "Library configuration" is very brief and incomplete (e.g. there is nothing further about loading after the manual says "They can be loaded as described below"), so I don't know how to tell cppcheck to look for a config file in different locations, or even if this is possible.
Any feedback welcome,
thanks.
Cppcheck does use the
noreturn
attribute, but checking for__GNUC__
wont make it available for cppcheck.Yes. Do you provide
-D__GNUC__
flag somehow in Cppcheck analysis? Can you give some example code that does not work as expected?I have tested with the
-D__GNUC__
and that does do what I want ... THANKS!