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 excludefunc1but includefunc2in the analysis, do something like:Related:
__COVERITY__.skip_filedirective, which can be used to exclude entire files.