Looking for a way to configure coverity to ignore certain code sections.
For example let's say I have source code with func1
and func2
.
I don't want coverity to analyse func1
, but I still want it to analyse func2
.
Is there a way to do that?
Is there a special inline comment that I can add perhaps?
int func1(int* value)
{
*value++;
return 0;
}
int func2(int* value)
{
*value--;
return 0;
}
You can exclude a section of C/C++ code using the __COVERITY__
preprocessor macro, which is defined by the Coverity compiler. For example, to exclude func1
but include func2
in the analysis, do something like:
#ifndef __COVERITY__ // <-- added
int func1(int* value)
{
*value++;
return 0;
}
#endif // <-- added
int func2(int* value)
{
*value--;
return 0;
}
Related:
__COVERITY__
.skip_file
directive, which can be used to exclude entire files.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With