My company has the PC-lint executable lint-nt.exe.
I am trying to use this to integrate PC-lint with MS Visual Studio 2008 to analyze .c/.cpp sources. But I have no success with getting that to work.
I read:
http://www.gimpel.com/html/pub80/env-vc9.lnt
and similar such info on one or two other sites, but no success.
I followed the indicated steps to add an external tool in Visual C++ 8, but when I click on the newly added tool, the pc-lint window opens momentarily and is closed immediately, and I doubt it has run any analysis. So its not working for me.
Then I tried running lint-nt.exe on a windows command prompt as
lint-nt.exe +fce +fcp +cpp(cpp,cxx,cc) -i"C:\Program Files\Microsoft Visual Studio 9.0\VC\include" +libdir +libh myfile.cpp
It did perform the analysis but it analyzed a lot of header files from the Visual C++ INCLUDE folder (limits.h sal.h iostream etc..), because my source file had #include <iostream>
and so on.
EDIT: I see pc-lint has options +/-libdir
, +/-libh
and such options, which might help, but I just could not use them correctly to avoid the analysis of compiler headers.
Two questions:
- How do I prevent pc-lint from analyzing the compiler header files and only analyze my source code files?
- How to integrate pc-lint into Visual C++ 2008 Express edition, which I am using?