If your company has the Lint executable, it will also have the PC-Lint manual in PDF form if not on paper. It is delivered on the CD-ROM together with the executable. That manual is your friend, to figure out how to use all the many options available.
To your question:
- To get started quickly, remove the
+fce
,+fcp
,+libdir
and+libh
options from your command line. I suppose you are just missing the-wlib(1)
option to remain silent about the many warnings the MS libraries produce. Do not use-wlib(0)
: You will have silenced all options for the library headers, but incorrect configurations originating in those library headers may produce a truckload of warnings in your code where you could not find the culprit hidden in those compiler headers. - The link of user34341 is not a bad start, although I have some problems following along precisely. And the env-vc9.lnt from the Gimpel website assumes that you have installed PC-lint with their installer. Reading between the lines of your question, I guess you have not. The details of creating such an installation including the generation of the PC-lint option file std.lnt take us too far for this answer, but I have written a PDF document "How to wield PC Lint" explaining this all in painful detail. If you combine the link from user34341, the options file from Gimpel and my document, you should be OK.
Furthermore: The env-vc9.lnt only contains the option for using the VC9 environment (a.k.a Visual Studio); to support the C/C++ compiler you'll need the appropriate compile option file http://www.gimpel.com/html/pub80/co-msc90.lnt and its associated (Lint-only) header file http://www.gimpel.com/html/pub80/co-msc90.h.
So before you start integration in VS2008, download them and try this command line:
lint-nt.exe +cpp(cpp,cxx,cc) co-msc90.lnt myfile.cpp
and see if the results are better than before. The -i
option was OK, but if you have the environment variables (e.g. %INCLUDE%) set up correctly for Visual Studio, it shouldn't be necessary.
And one more hint: Assuming you have not done so already, look at the version of PC-lint you have available, and make sure to update to the latest patch level: 7.50ad, 8.00x, 9.00i (current version); the links under the version numbers take you to the appropriate website page. It will save you a lot of trouble. I know that getting the latest version is not always an option, even if highly preferable.