Visual Lint Getting Started Guide

If this is the first time you have used Visual Lint, you may find the following introductory information useful. Please feel free to contact us if you have any specific queries.

  1. Introduction
  2. Installation
  3. Configuration
  4. Using Visual Lint
  5. Accelerating Analysis Using IncrediBuild
  6. FAQ
  7. Support
  8. Visual Lint Product Page
  9. Riverblade Developer's Blog  RSS feed

 

Introduction

Visual Lint integrates code analysis tools including PC-lint, CppCheck, cpplint and FxCop within the Microsoft Visual Studio and Eclipse integrated development environments. Among the features which you might want to be aware of are:

  • The Configuration Wizard allows for straightforward configuration of Visual Lint for use with supported analysis tools.
  • Automatic background analysis of files and projects within the current solution. Multiple files can be analysed simultaneously, with user preferences determining the maximum number of analysis threads.
     
  • When a file is opened for editing within the development environment, the corresponding analysis results are automatically presented in a dedicated Analysis Results Display. Double clicking on a warning message in either display will open the corresponding source file at the offending line, and where possible display information on what the issue actually means.
     
  • When files are saved, they are automatically queued for re-analysis.
     
  • Detailed HTML reports can be produced in a similar format as Riverblade's LintProject command line tool.
     
  • Easy access to the manual or helpfile for each code analysis tool within the development environment.
     
  • Direct editing of the analysis configuration (e.g. the PC-lint std.lnt and options.lnt indirect files) within the development environment.
     
  • Visual Lint is compatible with Microsoft eMbedded Visual C++ 4.0, Visual C++ 6.0, Visual Studio .NET 2002, Visual Studio .NET 2003, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010 and Eclipse/CDT (versions 3.4 onwards). When installed, it will make itself available to any supported development environments on your system.

 

Installation

When run, the installation program will install the Visual Lint plug-ins (VisualLint.dll and VisualLintEclipse.dll) to the selected directory (C:\Program Files\Riverblade\Visual Lint by default), and configure all supported environments to load it.

Once installed, Visual Lint commands can be invoked from the "Visual Lint" toolbar or (if available) via the corresponding commands on the "Tools" menu.

 

Configuration

Before starting to use Visual Lint it is necessary to configure it for the analysis tools you intend to use. The simplest way to do this is to run the Visual Lint Configuration Wizard:

Configuration Wizard Intro Page  Configuration Wizard Tools Page

Configuration for CppCheck, cpplint or FxCop analysis

Configuration for these analysis tools is straightforward - in fact in most cases, all you will need to do is install the analysis tool and tell Visual Lint where to find it:

Configuration Wizard Select Folder Page  Configuration Wizard Completion Page

 

Configuration for PC-lint analysis

Configuration for PC-lint analysis is a bit more involved, as it needs detailed information upon the configuration of the C/C++ compiler in order to parse the code effectively.

Key to this are two configuration files - conventionally std.lnt and options.lnt. These files determine which configuration PC-lint will use for its analysis, and as such their contents are very important. Although a full discussion of the options which these files may contain is beyond the scope of this Guide, details can be found in the PC-lint manual.

The simplest way to configure these files is again to use the Configuration Wizard.

  1. The first step is to show Visual Lint where to find your PC-lint installation. If PC-lint has been installed using its installation wizard, Visual Lint will be able to discover the location of this folder from the registry key HKEY_LOCAL_MACHINE\Software\PC-lint\CONFIG\Version 9.0 (PC-lint 9.0) or HKEY_LOCAL_MACHINE\Software\PC-lint\CONFIG\Version 8.0 (PC-lint 8.0). If these keys are not present or the installation has subsequently been moved you will need to enter the location of your PC-lint installation manually in the Select Installation Folder page.

    Once set, these paths are recorded in the registry for subsequent use.

  2. Once the location of your PC-lint installation has been defined, the Select Files page will allow you to choose whether to create new std.lnt and options.lnt files or use existing ones. In the former case, the wizard will guide you through the process of creating both files; in the latter the wizard will allow you to edit their contents.

  3. If a new std.lnt file is being generated, the Configure std.lnt page allows you to define the contents of the configuration file using a simple interface. The main aim of this page is to configure which indirect (.lnt) files PC-lint should use by default. Note that only those indirect files in the PC-lint installation folder will be shown; these are those installed by the PC-lint configuration wizard.

    For details of which indirect files are available, please refer to the PC-lint support downloads provided by Gimpel Software at:

  4. Finally, the Preview page shows a preview of the text which will be written to both configuration files. In both cases, you can edit the text further here before proceeding.

  5. Once you are satisfied with the changes Visual Lint will make to the PC-lint configuration files, proceeding through the Completion page of the wizard will write the new configuration files to disk, whereafter they will be available for analysis purposes.

    It should be noted that the Configuration Wizard is not the only way to configure Visual Lint, as it is also possible to configure it via Visual Lint's own "Options" command on the toolbar or "Tools" menu.

Configuration Wizard Select Installation Folder Page

Step 1: Select your PC-lint installation folder

Configuration Wizard Select Files Page

Step 2: Select the std.lnt and options.lnt files to use.

Configuration Wizard Configure std.lnt Page

Step 3: Configure the contents of std.lnt

Configuration Wizard Previewt Page

Step 4: Preview

Configuration Wizard Completion Page

Step 5: Pressing Finish writes the changes to disk.

Once these files have been configured Visual Lint itself can be configured, using the Visual Lint "Options" command (on the toolbar and Tools menu). The following pages are provided:

  • Analysis - General options related to background analysis and the handling of "stale" files (those whose analysis results may be out of date).
     
  • Displays - Options relating to the presentation of analysis results and status information.
     
  • Categories - Defines the lint issue categories available (e.g Error, Warning etc.) and their properties.
     
  • Reports - Options affecting the way reports should be presented.
     
  • Command Line - Options related to the PC-lint analysis tool command line.
     
  • PC-lint/CppCheck/FxCop etc. - Shows the global configuration for the analysis tool of the same name.
     
  • Registration - Allows entry and display of user registration information.
     
  • Product Edition - Allows the active product edition to be changed during the 30 day trial period. This provides a way to to try out a particular product edition before the trial elapses.
     

Note that initially Visual Lint is configured not to start background analysis of files automatically. This, and how many analysis threads should be used, may be configured from the General options page.

 

Using Visual Lint

Analysing a file manually

Once Visual Lint has been configured, a simple and effective way to test its operation is to analyse an implementation file manually. To do this, simply open a C++ implementation file (it need not be part of a project), and press the "Perform Manual Analysis" button on the toolbar. A progress dialog will appear while the analysis takes place:

Manual analysis of the active source file

Note: Manual analysis is not currently available with the FxCop analysis tool. 

After a short delay (depending on how long the analysis tool takes to analyse the file) the results of the analysis will be displayed in the Analysis Results Display and (optionally) a dedicated pane in the Output Window:

 As you would expect, double clicking on an issue in the Analysis Results Display or Output Window will open the corresponding file in the editor. The display also allows the analysis results to be sorted and filtered.

 

Background Analysis

Background Analysis is a unique feature of Visual Lint. Once Visual Lint has been configured correctly, background analysis can be started or paused at any time from the toolbar or menu. As the analysis of a solution progresses, Visual Lint will build up an "analysis profile" of the solution which can be referred to at any time subsequently.

Following a build (during which analysis is automatically paused by default), any files which have been rebuilt will normally be queued for re-analysis. Previous analysis results remain available until updated, of course.

Background analysis is also of course normally paused while debugging.

 

Making use of Analysis Results

Once an analysis profile has been built up for a given solution, Visual Lint will use it to make the warnings for an implementation file available (via the Analysis Results Display (and optionally the Output Window) when a file is opened or activated in the code editor if the development environment is in design mode.

If an implementation file is saved, the analysis results will be queued for update automatically.

 

Viewing Reports

Visual Lint can constantly update an HTML report giving details of the warnings found in the current solution. At any time, this can be viewed either inside the development environment or in an external browser. The report format is very similar to those generated by LintProject.

 

Accelerating Analysis Using IncrediBuild

A complete PC-lint analysis run on a large solution can be a slow process. If you find this to be a problem, you might find it useful to know that Visual Lint Enterprise Edition can integrate with Xoreax IncrediBuild to transparently run analysis tasks on machines with spare processing capacity on your network. By doing so, the time taken to analyse solutions can be significantly reduced.

To activate the IncrediBuild integration, toggle the "Use IncrediBuild for analysis tasks" option on the Visual Lint Toolbar:

Enabling IncrediBuild analysis

Once activated, Visual Lint analysis tasks will be distributed across all available IncrediBuild agents:

Using Visual Lint and IncrediBuild together can result in a very substantial reduction in overall analysis time as you are effectively only limited by the number of available IncrediBuild agents on your network.

Please note that:

  • Visual Lint uses the XGE Interfaces Extension Package to interface to IncrediBuild 3.0 or later. If you do not currently have an XGE licence, you will need to purchase one from Xoreax before you can use this feature.
     
  • If you are running IncrediBuild 3.31 or earlier, any Visual Lint analysis tasks running under IncrediBuild will not be shown in the Build Monitor within the IDE (although they are shown in the standalone Build Monitor).
     
  • Versions of IncrediBuild prior to 3.51 requires administrative privileges to run. Therefore, to use IncrediBuild with Visual Lint the host IDE may need to be running with administrative privileges
     
  • The IncrediBuild interfaces do not provide a mechanism for external processes to determine which tasks are currently running. As a result, Visual Lint cannot display status updates for analysis tasks running under IncrediBuild until each task completes. This is most noticeable with whole project analysis.
     
  • If more than one instance of the IDE is running, tasks run via different IncrediBuild sessions can interfere with each other. We recommend that only one IDE session be run with IncrediBuild analysis tasks at a time.

 

FAQ
 

Which analysis tools does Visual Lint support?

Visual Lint currently supports the following analysis tools:

Analysis Tool  Language  Licence 
Gimpel PC-lint  C/C++  Commercial 
CppCheck  C++  Open Source 
Google cpplint.py C++  Open Source 
Microsoft FxCop 
C#  Freeware 
 
To use Visual Lint, you must therefore have access to at least one supported analysis tool. The "More Information" button on the  Configuration Wizard "Select Folder" page will open an appropriate download or purchase page for the selected analysis tool.

Please contact us if there is a particular analysis tool you would like to use with Visual Lint. 

Note: If you need to purchase a copy of PC-lint we can supply both LAN and Workstation licences directly - please contact us for details. Please contact Gimpel Software for support and other information regarding PC-lint.

 

Which platforms does Visual Lint support?

Visual Lint has been tested on Windows 2000 SP4, Windows Server 2003 (SP1 and R2), Windows XP (SP2 and SP3), Windows Vista (RTM and SP1), Windows 7 and Windows Server 2008. Both x86 and x64 installations are supported.

Please contact us if you have any queries about compatibility with a particular platform or service pack level.

 

Which versions of Visual Studio and Visual C++ is Visual Lint compatible with?

Visual Lint is compatible with eMbedded Visual C++ 4.0, Microsoft Visual Studio 6.0, Visual Studio .NET 2002, Visual Studio .NET 2003, Visual Studio 2005, Visual Studio 2008 and Visual Studio 2010.

Please contact us if you have any queries about compatibility with a particular environment or service pack level.

 

Which versions of Eclipse is Visual Lint compatible with?

Visual Lint has been tested with Eclipse 3.1 onwards using the MinGW toolchain. Please contact us if you have any queries about compatibility with a particular Eclipse configuration.

 

Which editions of Visual Studio and Visual C++ is Visual Lint compatible with?

Visual Lint is compatible with all editions of Visual C++ and Visual Studio, with the exception of Visual Studio Express Editions.

This restriction is not one of our choosing - unfortunately the Visual Studio Express Editions do not allow the loading of third party add-ins and extension packages. This is a limitation imposed directly by Microsoft themselves.

 

Does the Visual Lint installer include a trial version of PC-lint?

PC-lint does not have a trial version, and therefore we cannot (unfortunately) include it in the Visual Lint installer. You will therefore need a licenced PC-lint installation in order to use Visual Lint.

If you need to purchase a copy of PC-lint you can purchase one from our online store. Please contact Gimpel Software for support and other information regarding PC-lint itself.

 

Which programming languages does Visual Lint support?

Visual Lint currently supports analysis of C, C++ and C# codebases via a selection of analysis tools, with support for Java under development.

If you need support for another language or analysis tool please contact us and we will look into integrating it into Visual Lint.

 

How closely integrated into Visual Studio is Visual Lint?

Visual Studio .NET 2002, Visual Studio .NET 2003, Visual Studio 2005, Visual Studio 2008 and Visual Studio 2010 allow extremely close integration into the IDE. Under these environments, Visual Lint will integrate its commands into the Visual Studio menubar and command bars, and even add a "Perform Manual Analysis" command to the context menu in the code editor. The three Visual Lint toolwindows can be docked anywhere in the IDE, and can be pinned and autohidden just like any other window.

Under Visual C++ 6.0 and eMbedded Visual C++ 4.0 the level of integration we can offer is, unfortunately, rather more limited. Visual Lint will still create its own toolbar (named "VisLint" rather than "Visual Lint" due to the rather low level method we have to use to set the name), but it cannot add commands to the menubar or control the state of the toolbar commands (disabled, selected etc.) as the IDE simply does not provide the capability for add-ins to do this. Even worse, the IDE does not provide any capabilities to integrate third party toolwindows. We have, however, been able to integrate them into the Workspace View (but not the Output Window - at least not yet) using window subclassing techniques.

 

Can I pass my own parameters to the analysis tool?

Yes. The Command Line page in the Options Dialog provides a control which allows you to enter parameters to pass to the active analysis tool. Registered copies of Visual Lint Professional and Enterprise Editions also provide a similar capability on a per solution or per project basis.

Please contact us if you have specific requirements.

 

How do I change the font used in the Message Lookup Display?

By default, the Message Lookup Display uses a Courier font for displaying the details of selected messages. Although the font used in the display is not configurable via the user interface, it can be configured using the registry. To do this, all you have to do is set the following registry keys to the font name and size (in points) you wish to use:

HKEY_CURRENT_USER\Software\Riverblade\Visual Lint\Settings\Displays\Warning Lookup\Font Family
HKEY_CURRENT_USER\Software\Riverblade\Visual Lint\Settings\Displays\Warning Lookup\Font Size
We have created a registry export file which will do this for you (for Consolas 10 point) without having to fiddle around in the registry editor. Feel free to download it and modify to your preferred font settings.
 

How do I perform a silent installation of Visual Lint?

Silent installations are fully supported in Visual Lint. To perform a silent installation the following command line can be used:
VisualLintAddInSetup /s LICENCE_USER=<Licenced User> LICENCE_KEY=<Licence Key> /l=<logfile pathname>
LICENCE_USER and LICENCE_KEY are optional, and should be used if you need to install a licence key at the same time as the installation. Similarly, to uninstall use:
VisualLintAddInSetup  /s MODIFY=FALSE REMOVE=TRUE UNINSTALL=YES /l=<logfile pathname>

If you require a customised installation (for example to specify the installation folder or a group policy compatible installer) please contact us.

 

Support

If you have any problems, bug reports or suggestions, please email them to us at support@riverblade.co.uk. We will endeavour to provide bug fixes and other support as quickly as possible.

Since we try to produce updates as often as we reasonably can, so please visit the Visual Lint page on the Riverblade website (http://www.riverblade.co.uk/products/visual_lint) for the latest information before contacting us with a bug report. You may find that the bug you're about to report has already been fixed!

Finally, we hope you find Visual Lint useful. We would be very interested to hear your suggestions for improving it further.

 




Join the Visual Lint/LintProject mailing list

Enter your name and email address:

Name:

Email:

 

Subscribe      Unsubscribe