JB Enterprises

JB Enterprises - Johan Bezem

Interim Management & Consulting

JB Enterprises - Blog


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.

  1. My INCLUDE environment 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 your INCLUDE variable to reflect your compiler. Both can be achieved in a batch file.
  2. I cannot change the value of INCLUDE on 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 empty INCLUDE before calling Lint. That works even if your system’s include is forced to be set.
  3. I defined my own include variable MYINCLUDE, and used ‘-incvar‘ to activate it. Lint still uses INCLUDE, though. What can I do?
    A: According to my tests, Lint gives priority to an existing and valid INCLUDE variable. If the files can be found using INCLUDE, you are forced to delete or redefine INCLUDE.
  4. 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.
  5. 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 valid INCLUDE variable is taking precedence over ‘--i‘ paths. You’ll have to delete or redefine the INCLUDE variable.
  6. 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.

November 14th, 2007

Valid XHTML 1.0 Strict Valid CSS www.bezem.de: © 1999 – 2024 by Johan Bezem, all rights reserved.
This page was last updated on Tuesday, 2017-07-25 17:31.