0

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

4

2 回答 2

1

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.

于 2015-02-09T10:18:19.683 回答
0

Sorry for posting late but I found this thread when looking for ways to remove the -wlib(0) warning in the output.

So for others looking for that answer a simple -e686 before the -wlib(0) removes that warning from the output.

I understand this does not answer the original question, but sometimes this is what you want to do.

于 2021-09-08T09:16:31.293 回答