Products, the Universe and Everything

The Riverblade Developer's Blog

Beth demonstrating Visual Lint at the ACCU Conference 2008  Anna taking part in a discussion panel at the European Software Conference 2007 

Welcome to our developer's blog. We hope that this forum provides an insight into us, our products and how we develop them. Please feel free to write to us if you have anything to add to any of the posts here.

Current Entries | Archives |

Introducing support for Borland/CodeGear C++ Builder in LintProject Professional
Wednesday, August 19, 2009

A couple of months ago I wrote about our long term plans with for support for non-Microsoft project file formats in both Visual Lint and LintProject Professional (see Non-Microsoft Platforms, Visual Lint and LintProject Professional. At the time, we presented as an example Texas Instruments Code Composer Studio 3.x (.pjt) project files, and described what we were doing to add support for them to LintProject Professional.

Since then we have been building on that foundation by implementing project file parsers for the various Borland/CodeGear C++ Builder project and project group (the C++ Builder equivalent of a Visual C++ workspace or solution) file formats.

The reasoning behind this is simple - although PC-lint can parse most C++ code without any issues, to do well so it needs to be given not only compiler/library options files but also indirect files containing preprocessor and additional include folder definitions for each project configuration to be analysed. In all but the most trivial cases, this requires that the project files be parsed - and since each compiler vendor has its own ideas about what such a project file should look like (and frequently changes them in subtle or not-so-subtle ways...) this is a decidedly non-trivial problem.

In the Visual C++ world PC-lint has for some time been able to handle basic project files (.dsp and more recently .vcproj) and generate the corresponding project indirect ("project.lnt") files for you. Having said that, when we were originally developing Visual Lint it quickly became apparent that this support was limited in some areas (e.g. it doesn't read for-loop compliance options or inherited property sheets files) and this led us to write parsers for these Visual C++ project file format. As a result, Visual Lint is able to generate far more accurate project.lnt files than PC-lint alone - a fact that can in many cases easily be seen in the analysis results produced.

The same is true for C++ Builder. Although PC-lint can in fact read C++ Builder 5.0/6.0 project (.bpr) files, its ability to do so is quite limited. Furthermore, it cannot handle the newer C++ Builder 2007/2009 formats* at all.

* Being MSBuild based, these are far more complex than their predecessors - as is the the new .vcxproj project file format used by Visual Studio 2010. Again, this cannot be read by PC-lint itself - but LintProject Professional already has a parser for it.

As a result, the adoption of PC-lint within the C++ Builder developer community seems to have been marginal at best (I know I'm sticking my neck out here, but that's the distinct impression we get from speaking to C++ Builder developers who have tried to use it).

The good news is that this work has now borne fruit - from LintProject Professional onwards the various C++ Builder project and project group file formats are directly supported:

LintProjectPro help screen lists the available project file formats

We are pretty confident that this version should be able to handle the majority of C++ Builder project files, but of course any edge cases and oddities can be dealt with through the normal support/release cycle (as we already do for Visual C++ project files).

Note that we have not (yet!) tested this build with the forthcoming C++ Builder 2010, but as the file format for this version is (apparently) identical to that of C++ Builder 2009 we are not anticipating any significant issues in doing so.

In the longer term our plan is actually to be able to make a version of Visual Lint available which can handle C++ Builder projects directly - either as a standalone GUI (the most likely option, since it will let us target project file formats for embedded IDEs as well) or even (if resources permit) as a native C++ Builder plug-in. That's still some way off though, and in the meantime we hope that LintProject Professional will prove to be an effective way to use PC-lint static analysis with C++ Builder projects.

We look forward to working further with developers within the C++ Builder community. Our thanks in particular go to those who have helped us extensively in the development of this exciting new capability for LintProject Professional.

Posted by Anna at 12:44 | Get Link


LintProject Professional has been released
Tuesday, August 18, 2009

The following changes are included in this build:
  • Visual C++ 2008 project (.vcproj) files created using the "Create Project from Existing Code" wizard are now parsed correctly (such project files are created with UTF-8 encoding instead of the usual Windows-1252, and it seems that MSXML does not correctly support loading an XML stream with a UTF-8 byte-order mark from a Unicode string) [from Visual Lint].

  • Added support for reading XML format analysis results generated using the env-xml.lnt indirect file.

  • Added support for Borland C++ Builder 5.0/6.0 project group (.bpg), project (.bpr) and package (.bpk) files. The PC-lint environment file env-xml.lnt is used by default with these files.

  • Added support for Borland C++ Builder 2006 project project group (.groupproj) and project (.bdsproj) files. The PC-lint environment file env-xml.lnt is used by default with these files.

  • Added support for CodeGear C++ Builder 2007/2009 project group (.groupproj) and project (.cbproj) files. The PC-lint environment file env-xml.lnt is used by default with these files.

  • Solution/workspace configurations specified on the command line are now case-independent.

  • Added -fpa to the generated command line. This is necessary for limited compatibility with env-cb.lnt, which contains a +fpa option which causes a "Type any key to terminate" message to be output to the console on the completion of analysis of each file.

  • The PC-Lint environment options (env-*.lnt) file used is now displayed on the console. If the file is not available an error will be raised.

  • Added a new option (/env) to allow the env-*.lnt file to be specified on the command line.

  • If the env file specified (or selected by default) is not found in the PC-lint LintProject Professional will try to copy it from the "lnt" subfolder within the PC-lint installation.

  • The project name shown in reports is now always that specified in the project file, rather than the name of the file itself.

  • Fixed a bug which could cause project status to be momentarily shown as "Underway (100%)" in analysis reports.

  • Further improvements to the analysis results parser.

  • Corrected a bug in the analysis results parser which was causing Internal Errors in the range 200-299 to be incorrectly categorised as Fatal Errors.

  • Minor improvements to the console output during analysis.

Posted by Anna at 12:49 | Get Link