4

I am using PC lint in my project. My project is compatible to build in both windows and linux. So i have used windows header(visualstudio) files and linux header files(gcc) in my project. I am running pclint entirely for all the file. Its giving error message

Unable to open include file *.h

I dont want to suppress this error in std.lnt file and i dont want to add

-elint errorcode
before the include statement. Please suggest me is there any way to suppress particualar headerfiles in std.lnt file.
cafce25
  • 15,907
  • 4
  • 25
  • 31
rashok
  • 12,790
  • 16
  • 88
  • 100

2 Answers2

2

I am assuming that you don't really get message

Unable to open include file *.h

but are really getting message

Unable to open include file fred.h

for some file fred.h.

If I am correct, then add these two lines to std.lnt:

-efile(322,fred.h)
-efile(7,fred.h)
Bill Evans at Mariposa
  • 3,590
  • 1
  • 18
  • 22
1

Protect the relevant includes with platform-dependant preprocessor symbols:

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

Then make sure you define PLATFORM_PC when checking the code with PC-Lint, so that it never sees the includes for the platform it doesn't understand.

unwind
  • 391,730
  • 64
  • 469
  • 606