LintProject Pro has now been superseded by Visual Lint Build Server Edition, and new LintProject Pro licences are no longer available. Please see the blogpost LintProject Pro End of Life Notice for support and upgrade details.
- Command line code analysis - ideal for use with build servers
- Produces graphical HTML reports describing which lint issues are present in your codebase, and where
- Comprehensive handling of C++ project files - even those making extensive use of internal IDE environment variables and inherited properties or property sheet files
- Compatible with projects from both current and legacy versions of Microsoft Visual Studio and Visual C++, Borland/CodeGear C++ Builder as well as selected embedded environments
- Compatible with Intel C++ Compiler projects
- Compatible with PC-lint 7.5, 8.0 and 9.0, as well as CppCheck (v1.43 or later)
LintProject Professional is a command line product intended to make the process of using static code analysis tools with C/C++ projects a little easier and more productive. It replaced the previous LintProject tool, extending greatly the level of detail included in the generated reports and providing far greater compatibility with C/C++ project files.
Like Visual Lint, LintProject Professional uses third party static code analysis tools (Gimpel PC-lint or CppCheck) to perform the analysis. As such, you will need a valid PC-lint or CppCheck licence and installation in order to be able to use this software. CppCheck is open source and can be freely downloaded from http://sourceforge.net/projects/cppcheck/.
PC-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)
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 LintProject Professional
LintProject Professional was written to address two of these issues. Unlike PC-lint, LintProject Professional can read both project and solution/workspace files.
LintProject Professional can be run against either a complete solution/workspace or an individual project:
- When run against a project, it reads the project file 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 Professional reads the solution or workspace file and recursively analyses the projects it contains.
Whilst 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 HTML reports (in a very virtually identical format to those produced by Visual Lint Enterprise Edition) which contain a detailed analysis of the results files and indicate which lint issues were found within each implementation file, project and solution:
Example HTML report
A key design aim of LintProject Professional was to be capable of indicating its process whilst it ran. 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 Professional are automatically regenerated as the analysis progresses.
Using LintProject Professional
Once installed a LintProject Professional command prompt can be easily run from the supplied shortcut which temporarily adds the path of the installation directory to the system path. The /folder switch can then be used to tell it where to find the PC-lint executable.
LintProject Professional is invoked by a simple command line, for example:
LintProjectPro <SolutionName.sln/dsw> <ResultsFolder> [options], or:
LintProjectPro <ProjectName.vcproj/dsp> <ResultsFolder> [options]
There are a number of additional options, for example:
/toolname=<CppCheck | PC-lint>
Specifies the analysis tool to use.
Specifies the location of the PC-lint installation folder.
Specifies the filename of the lint indirect file to use. If omitted, std.lnt is assumed.
Specifies the solution configuration to be analysed. Similarly, /config? will list the available configurations.
Saves the current PC-int installation folder settings to the registry so that /toolfolder and /configfile can be omitted next time LintProject Professional is run).
Specifies that the HTML report should be automatically opened in a browser window when analysis starts.
Passes the following parameters to the analysis tool. For example, /param" -background" will instruct PC-lint to perform analysis at a low priority.
Display help information