pvs-studio

PVS Studio: Suppress V677 from cross-compiler system libraries


I'm compiling a project for Cortex-M processor, which has compiler-specific libraries for standard types. When I analyze the project with PVS-Studio, any real positives get drowned under

/opt/local/gcc-arm-none-eabi-7-2018-q2-update/arm-none-eabi/include/sys/_stdint.h   20  warn    V677 Custom declaration of a standard 'int8_t' type. The declaration from system header files should be used instead.

I'm familiar with this question, but in my case I have to use the compiler headers and adding the compiler paths to exclude list doesn't help as the issue is in inclusions after preprocessing.

Is there a way to suppress the errors coming from the included folders, or to suppress the error type in the config file?


Solution

  • I'm familiar with this question, but in my case I have to use the compiler headers and adding the compiler paths to exclude list doesn't help as the issue is in inclusions after preprocessing.

    Even if a header file is included into the resulting preprocessed file, as long as the preprocessed file contains the original path of the included header, the exclusion mechanism described in the question you were referring to will still work, i.e. it should exclude the messages from the included header. Have you tried adding a directory containing the system headers to PVS-Studio exclude dirs?

    Also, you can try filtering resulting analysis results, after the analysis, with plog-converter tool.

    Is there a way to suppress the errors coming from the included folders, or to suppress the error type in the config file?

    You can try using special comments inside the source or .pvsconfig files to disable specific analyzer diagnostics.