Johan Bezem ist Mitglied bei
Posts Tagged ‘HowTo’
Two new articles: Physical Architecture and Coding Conventions
I just added two articles, again, the basics of which have been written some time ago, but now I revamped them and put them on the website.
And since the number of articles (or: white papers) has grown, I have dedicated a new page to these “white papers”.
I now express my opinion on physical architecture (in contrast to the logical software architecture everyone learns when trying to learn programming), and on the almost religious topic of coding conventions. Have a look at the new white paper page!
Johan
New version of “How To Wield PC-Lint”
I finally got to adapt my document for the most recent Lint version 9.0b. I have replaced the original document, but if you just want to see where the changes have been incorporated, a version with change bars is available.
Happy linting!
Updated version of “How to wield PC Lint”
With some more experience from some different environments, I have felt the need to update my document on “How to wield PC Lint”. The main changes I made to the document:
- the Gimpel-provided compiler support files ‘co-*.lnt’ may be a fair starting point, but certainly not the final word;
- I changed the name for my output file to ‘lintout.out’, for one project the names ‘error’ and ‘errors’ were already in use, and using the extension ‘lnt’ doesn’t seem a good idea anymore;
- I now use quotes around the filename for Lint’s output messages, to accommodate environments using spaces in path names;
- I added a warning about suppressing errors numbered less than 400;
in addition to some small corrections.
Have fun!
Johan
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.
How to wield PC Lint
This entry is more for testing my blog, but at the same time my first tip for those looking for PC Lint support. Only that this tip is already published on my regular website.
I wrote a few pages on “How to Wield PC-Lint“, for setting up and deploying Lint, and making sense of the truckload of messages an initial deployment will present. Have look at the PDF, and use it to your advantage.
Deutsch
English
Nederlands