How to handle include paths in PC Lint
Include file processing can be a bit tricky. Here I present a few Q&A on processing include files, and specifying paths.
- My
INCLUDEenvironment variable is set for Microsoft compilers. If I Lint for <name your compiler here>, Microsoft includes are processed. What can I do?
A: Well, for one, you can delete the environment variable for the shell you use. You may redefine yourINCLUDEvariable to reflect your compiler. Both can be achieved in a batch file. - I cannot change the value of
INCLUDEon my system. Can I tell Lint to simply ignore it?
A: I haven’t found a way using options in Lint, so until someone tells me how it can be done, I’d say ‘no’. However, you can write a small batch file to emptyINCLUDEbefore calling Lint. That works even if your system’s include is forced to be set. - I defined my own include variable
MYINCLUDE, and used ‘-incvar‘ to activate it. Lint still usesINCLUDE, though. What can I do?
A: According to my tests, Lint gives priority to an existing and validINCLUDEvariable. If the files can be found usingINCLUDE, you are forced to delete or redefineINCLUDE. - I have written my own version of (example) ‘
stdio.h‘. Lint refuses to find that file. What can I do?
A: Lint processes ‘-i‘ options for specifying include paths in order. Chances are, that you compiler’s include path is specified before your application’s. Use the verbosity options ‘-voif‘ (large output!) to see what order is presented to Lint, and change it, or use ‘--i‘ (double dashes!) to indicate the compiler’s include path. See the ‘readme.txt‘ for the current patch level for details. - I used ‘
--i‘ to indicate my compiler’s include path, but now Lint is finding Microsoft’s include files again. What can I do?
A: According to my tests, a present and validINCLUDEvariable is taking precedence over ‘--i‘ paths. You’ll have to delete or redefine theINCLUDEvariable. - I need to see what files Lint is using exactly, which ‘
-i‘/’--i‘ options it is processing and in which order. What can I do?
A: It will produce an enormous amount of output, but ‘-voif‘ (in addition to your normal options, preferably as one of the first options on the command line) will provide the information you need.
For all options presented here, look in the manual, or see the ‘readme.txt‘ as presented on the support pages of Gimpel’s website.
Deutsch
English
Nederlands