IntroductionLintProject is a command line tool intended to make the process of using the PC-Lint code analysis tool produced by Gimpel software with Visual C++ projects a little easier and more productive. 
BackgroundPC-Lint analyses C++ code to identify potential problems. By comparison with a C++ compiler such as that provided with Visual C++, it is highly customisable and very thorough, but (understandably) significantly slower.
The output it produces is file based and directed to the console by default, for example: --- Module: CJFlatHeaderCtrl.cpp } CJFlatHeaderCtrl.cpp(160): error 1401: (Warning -- member 'CCJFlatHeaderCtrl::m_bSortAsc' (line 146, file ..\Include\CJFlatHeaderCtrl.h) not initialized by constructor) } CJFlatHeaderCtrl.cpp(166): error 1740: (Info -- pointer member'CCJFlatHeaderCtrl::m_pParentWnd' (line 150, file ..\Include\CJFlatHeaderCtrl.h) not directly freed or zero'ed by destructor -- Effective C++ #6) --- Global Wrap-up error 900: (Note -- Successful completion, 2 messages produced) Although PC-Lint does a great job of analysing C++ source and header files for potential problems, it is a generic cross-platform tool and as such its integration with development environments is limited. For example, when used with Visual C++ PC-Lint can be used to scan the current file for warnings and direct the results to the Output window, or to scan a list of files defined in a text file.
While this level of integration is perfectly adequate under some scenarios (for example when developing new classes), it is less than ideal if you want to perform a complete analysis of an entire project or solution. Furthermore, since PC-Lint does not provide any means of generating useful reports on the results it can be difficult to spot potential problems amongst the mass of results.
If you are working with a large project these limitations can make using PC-Lint to analyse your code time consuming and difficult, which can potentially this can be a real disincentive to using this very useful tool on a regular basis.
As a result, the quality of your code could well suffer. Introducing LintProjectLintProject was written to address two of these issues. Unlike PC-Lint, LintProject can read both Visual C++ project and solution files.
LintProject can be run against either a complete solution or an individual project: - When run against a project, it reads the Visual C++ project file (.dsp or .vcproj) and instructs PC-Lint which files to analyse. For each file analysed, the PC-Lint output is captured and recorded in a text file for later analysis.
- When run against a complete solution, LintProject reads the Visual C++ solution file (.sln or .dsw) and recursively analyses the projects it contains.
XML and HTML ReportsWhilst the availability of text files containing the results of the analysis is an essential result of the process, without a means of summarising their contents and indexing them the process of interpreting the results is likely to be slow and laborious.
LintProject provides a convenient solution to this problem by writing XML and HTML reports which link to the results files and indicate how many warnings were found within each implementation file, project and solution: 
Example HTML output A key design aim of LintProject was to be capable of indicating its process whilst it runs. This is especially important when you consider that a PC-Lint analysis of a large project can take some considerable time on some systems. To achieve this aim, the output reports produced by LintProject are automatically regenerated as the analysis progresses.
Possibly the most useful feature of LintProject is that whilst it is running, any supported browser windows* displaying the corresponding results files will automatically refresh as each file is analysed. This gives immediate feedback on the progress of the analysis, and is proving to be a very useful feature. * At present this feature is limited to Internet Explorer and derived browsers such as Crazy Browser, Avant browser etc..
InstallationInstallation of LintProject is straightforward. The simplest method is simply to place the executable (LintProject.exe) into the same folder as the PC-Lint executable (lint-nt.exe). If you prefer to locate LintProject.exe elseware, the /f switch can be used to tell it where to find the PC-Lint executable. Using LintProjectLintProject is invoked by a simple command line, for example: LintProject <SolutionName.sln> <ResultsFolder> [options], or:
LintProject <ProjectName.vcproj> <ResultsFolder> [options] There are five additional options:
/f<FolderName> Specifies the location of the LintProject executable. This is only required if LintProject is installed in a different folder from the PC-Lint executable. /configfile<FileName> Specifies the filename of the lint indirect file to use. If omitted, std.lnt is assumed. /cfg<ConfigName> Specifies the solution configuration to be analysed. /s Specifies that the HTML output should be automatically opened in a browser window when analysis starts. /l"<parameters>" Passes the following parameters to the PC-Lint executable (lint-nt.exe). For example, /l" -background" will instruct PC-Lint to perform analysis at a low priority. /? Display help information
CreditsThe original version of LintProject was written by Anna during her employment at Sonardyne International Limited . We would like to express our gratitude to them (and in particular Bruce Baker and Richard Baldock) for agreeing to release ownership of the source to us so that we could maintain and further develop it.
Finally...If you find LintProject useful, we
encourage you to take a look at Visual Lint - Riverblade's solution for
developers who require close integration with Microsoft Visual Studio.
In addition to the report generation capabilities offered by
LintProject, Visual Lint also offers features such as background Lint
analysis of source files and the ability to double click on a warning
message and open the corresponding line in the code editor.
LintProject is
freeware. You may use it without restriction, provided all copyright
notices in the code and stylesheets remain intact. We hope it proves to
be as useful to you as it has to us, and we welcome your suggestions
for future enhancements and improvements.
|