Saturday, December 8, 2012

PC-Lint might include wrong system header files

PC-Lint uses by default the environment variable INCLUDE to find system header files. This environment variable might not be set suitably, especially if you have multiple toolchains installed.

In my case I ended up with PC-Lint including Visual Studio header files when checking a Renesas HEW compiled code base. The worst: I got plausible results, so I found it out only accidentally when I switched on the -vf option.

Running PC-Lint with the -vf option from time to time is a good idea anyway to check which files are considered library headers or library modules, which files are actually processed and - which headers are included.

To fix the behavior of PC-Lint I suggest: -incvar(PLEASE_IGNORE_INCLUDE) This tells PC-Lint to use the environment variable PLEASE_IGNORE_INCLUDE instead of INCLUDE. I found no way to just tell PC-Lint not to use any environment variable, just how to change the name of the used environment variable.

No comments:

Post a Comment