cpc-lint

PC-Lint: Ignore Library errors


I'm using PC-Lint to lint a C project. I want to ignore errors and warnings in third party libraries, but I'm not able to get this. Reading the manual, I check all #include files specified with angle brackets are considered as libraries.

[...] and you want this header to be regarded as a library header use angle brackets as in: #include <\include\graph.h>

Or for example, using the -libh command to indicate that header file is a library.

Using the option -vf, I've verified that my library files are being included as libraries. So everithing is OK.

The problems is that I'm receiving lot of errors from these files. I thought that since these files are considered as libraries, errors would be ignored.

How can ignore errors in library files? I've tried with -wlib(0), but this option ignore errors in header files too. In addition, generates an umcofortable warning:

Warning 686: Option '-wlib(0)' is suspicious because of 'the likelihood of causing meaningless output'; receiving a syntax error in a library file most likely means something is wrong with your Lint confinguration

Any suggestion? Thanks in advance


Solution

  • I had to read several times the PC-Lint manual and check the output log several times. The "problem" is by default the expression

    +libclass(angle, foreign)

    is enabled, so all .h files are considered libraries. It is necessary to overwrite this expression by using:

    +libclass(angle)

    In order to treat these files as headers an not libraries.

    Thanks again.