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 the Gimpel PC-Lint code analysis tool within the Microsoft Visual Studio integrated development environment. Among the features which you might want to be aware of are:

  • 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 IDE, 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 display information on what the warning 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 PC-Lint manual (a PDF file) from within the Visual Studio IDE.
     
  • Direct editing of the main PC-Lint configuration files (conventionally std.lnt and options.lnt) within the Visual Studio IDE. A Configuration Wizard is also provided to assist in creating and configuring these files.
     
  • 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 and Visual Studio 2008. When installed, it will make iteself available to any supported IDEs on your system.

 

Installation

The installation program will install the Visual Lint add-in (VisualLint.dll) to the selected directory (C:\Program Files\Riverblade\Visual Lint by default), and configure all supported installations of Visual Studio and Visual C++ to load it.

Once installed, Visual Lint commands can be invoked from the "Visual Lint" toolbar or via the corresponding commands on the "Tools" menu (the latter available when hosted in Visual Studio .NET 2002 or later).

 

Configuration

Before starting to use Visual Lint it is necessary to configure PC-Lint appropriately. 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 to use the Configuration Wizard included within Visual Lint.

  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. For PC-Lint to be effective, the include folders used by Visual Studio must be included within one of its configuration files - usually std.lnt. The Include Folders page shows the include folders which will be written to the selected std.lnt file.

  5. 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.

  6. 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 Include Folders Page

Step 4: Check Include Folders

Configuration Wizard Previewt Page

Step 5: Preview

Configuration Wizard Completion Page

Step 6: 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.
     
  • Visual C/C++ - Shows the PC-Lint folder and configuration file pathnames currently in use.
     
  • 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 Lint Analysis" button on the toolbar. A progress dialog will appear while the analysis takes place:

Manual Lint Analysis

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

A dedicated Analysis Results Display shows analysis results

A dedicated Analysis Results Display shows analysis results

Analysis results are also shown in the Output Window

Analysis results can also be shown in the Output Window.

 As you'd expect, double clicking on a lint issue in the Output Window or Analysis Results Display will open the corresponding file in the editor. It will also show a definition of the message in the Lint Message Lookup Display (shown above in the right hand screenshot). The Analysis Results Display offers similar functionality, but also allows the analysis results to be sorted and filtered.

 

Background Analysis

Background Lint 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 IDE is in design mode.

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

 

Viewing Reports

Visual Lint constantly updates an HTML report giving details of the warnings found in the current solution. At any time, this can be viewed either inside the Visual Studio IDE 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.
     
  • Any Visual Lint analysis tasks running under IncrediBuild are not shown in the Build Monitor within the IDE (although they are in the standalone Build Monitor).
     
  • IncrediBuild requires administrative privileges to run. Therefore, to use IncrediBuild with Visual Lint the host IDE must 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 uses the PC-Lint C/C++ code analysis tool. To use Visual Lint, you must have a licenced copy of PC-Lint.

If you need to purchase a copy of PC-Lint and are located within Europe, we recommend PhaedruS SystemS - the only European distributor able to supply PC-Lint and Flexelint site licences. 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) 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 and Visual Studio 2008.

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

 

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.

 

Which versions of PC-Lint is Visual Lint compatible with?

Visual Lint is compatible with PC-Lint 7.50, 8.00 and 9.00 (PC-Lint 8.00x or 9.00a is recommended).

 

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 and are located within Europe, we recommend PhaedruS SystemS - the only European distributor able to supply PC-Lint and Flexe-lint site licences. Please contact Gimpel Software for support and other information regarding PC-Lint.

 

Which programming languages does Visual Lint support?

Visual Lint currently supports the same languages supported by PC-Lint - namely C and C++.

If you require support for another language we encourage you to write to Gimpel Software and ask them about support for the language you are interested in.

Alternatively, if you know of an alternative command line lint tool which provides the analysis capability you need, 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 and Visual Studio 2008 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 Lint 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 PC-Lint executable?

Yes. The Command Line page in the Options Dialog provides a control which allows you to enter parameters to pass to the PC-Lint executable. 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.

 

Some of the links in the reports don't work

This is a direct result of the "Local Machine Zone Lockdown" policy introduced in Windows XP SP2, which prevents Javascript code (which is included in the HTML reports to provide table sorting facilities) from running when HTML pages are accessed locally.

The following articles discuss the lockdown and its implications:

According to the articles we've read on this, it should be possible to circumvent this by adding "The mark of the web" (in Microsoft terminology to the generated HTML. Unfortunately, so far this has proved unreliable - possibly due to the way the XSLT transformation formats line endings. We will continue to look for a way to circumvent this restriction, but for now simply click on the Information Bar when the warning appears and select the "Allow Blocked Content" option.

Note that this issue only affects Internet Explorer. Other browsers should be unaffected.

 

I tried to register the add-in using Visual Studio 6.0 or Visual C++ 6.0, and received lots of error messages

When the add-in is loaded by browsing it via the Visual Studio 6.0 "Customize" dialog, Visual Studio 6.0 will enumerate the COM interfaces registered by the add-in, and (rather unfortunately) will assume that any interfaces it finds are Visual Studio 6.0 add-in interfaces.

As a result, as well as the VS6 Visual Lint add-in itself (titled as "Visual Lint for VC6" in the "Customize" dialog) the interfaces for the VS2002/2003/2005 add-in and all ActiveX controls implemented within the add-in will also be displayed within the "Customize" page:



Consequently, error messages will be seen if any of the non-VS6 interfaces are selected when the "Close" button is pressed. To avoid this, deselect the following interfaces before pressing "Close":
  • WarningLookupToolWindowCtrl class
  • AnalysisStatusToolWindowCtrl class
  • AnalysisHistoryToolWindowCtrl class
  • AnalysisResultsToolWindowCtrl class
  • AnalysisGraphToolWindowCtrl class
  • Connect Class
As with all IDE bugs, we are researching workarounds for this issue. As Visual Studio 6.0 and Visual C++ 6.0 are no longer supported by Microsoft, a fix for the bug itself is highly unlikely.

 

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 2.0. 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