How to exclude some of "unable to open include include * .h file" in pclint

I am using PC lint in my project. My project is compatible for building in both windows and linux. Therefore, in my project, I used window header files (visualstudio) and linux header files (gcc). I run pclint completely for the whole file. His error message

  Unable to open include file * .h

I do not want to suppress this error in the std.lnt file, and I do not want to add

  -elint errorcode 
before the include statement. Please suggest me some way to suppress particualar header files in std.lnt file.
+4
source share
2 answers

I assume that you really do not receive the message

Unable to open include file *.h 

but really get the message

 Unable to open include file fred.h 

for some file fred.h.

If I'm right, add these two lines to std.lnt:

 -efile(322,fred.h) -efile(7,fred.h) 
+2
source

Protecting related inclusions with platform-specific preprocessor characters:

 #if defined PLATFORM_PC #include <whatever/is/needed.h> #else if defined PLATFORM_POSIX #include <stdio.h> #endif 

Then make sure that you define PLATFORM_PC when checking the code with PC-Lint, so that it never sees that it does not understand the platform.

+1
source

All Articles