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 |


On our way to the ACCU Conference
Sunday, March 30, 2008

ACCU Conference 2008

It's that time of year again. Tomorrow lunchtime Beth and I will be leaving the palm trees behind and driving up to Oxford for the ACCU Conference (we're going up a day early to do the "Fun with Erlang" pre-conference workshop).

This year we're sponsoring the conference for the first time (as we did with the European Software Conference last year, so if you would like a "show and tell" on any of our software please do come up and ask. Although we won't have a stand running throughout the whole week (the sessions are far too interesting for that!) we will have a stand at the sponsors reception on Wednesday morning.

If you miss us then, we will of course be happy to do impromptu demos in the bar on request.

I haven't gone through the conference schedule in detail yet, but if last year's event is anything to go by it will be informative, fun, and very, very tiring (and that's just the evening celebrations!).

We hope to see you there.

Posted by Anna at 18:54 | Get Link

 

.vsprops files and additional include folders
Tuesday, March 04, 2008

One of the most useful features of PC-Lint is its ability to process Visual C++ project files and generate .lnt files containing the corresponding project settings for a given configuration. This of course frees the user from the truly horrible (believe me, I've had to do it on occasion!) task of manually keeping the .lnt files and all the defines and include folder specifications they contain synchronised with the project files.

In most cases this works fine, although there can be subtleties in the project file formats which PC-Lint may be unaware of - for example for loop compliance (+/-ffb) options. To process these, Visual Lint includes a Visual C++ project file parser and project.lnt generator which it will by default use in preference to the equivalent PC-Lint capability. The capabilities of the project file parser and project.lnt generator are regularly updated to cope with special cases our customers have advised us of while using the product.

One such case we encountered recently (and is now handled correctly by Visual Lint 1.5.9.79) concerns .vsprops files. These are normally encountered when custom property pages are added to a Visual C++ project:, and as such we did not originally consider them in our project.lnt file writer:
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="VsPropsExample"
ProjectGUID="{F44065-0320-4B51-95FC-6EDCA5ECACA4}"
RootNamespace="VsPropsExample"
Keyword="Win32Proj">
<Platforms>
<Platform Name="Win32" />
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(SolutionDir)\solution.vsprops"
CharacterSet="1">
.
.
.
</Configuration>
</Configurations>
.
.
.
</VisualStudioProject>
As it turns out we were wrong in that assumption, since .vsprops files can also contain additional include folder specifications - as the following example shows rather well:

<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioPropertySheet
ProjectType="Visual C++"
Version="8.00"
Name="Solution"
InheritedPropertySheets="$(SolutionDir)macros.vsprops">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""$(MyIncludeDir)";"
DebugInformationFormat="3"
/>

</VisualStudioPropertySheet>
The InheritedPropertySheets attribute within his file shows another unexpected characteristic - these files can be nested. In this particular case, the file calls up another .vsprops file (macros.vsprops) prior to defining the additional includes. This defines the $(MyIncludeDir) project specific environment variable seen in the AdditionalIncludeDirectories attribute:

<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioPropertySheet
ProjectType="Visual C++"
Version="8.00"
Name="Macros"
>
<UserMacro
Name="MyIncludeDir"
Value="$(SolutionDir)\Include2\"
/>

</VisualStudioPropertySheet>
When Visual Lint reads a project configuration which includes an InheritedPropertySheets attribute, it will now recursively read the referenced .vsprops file (and any it references) and attempt to resolve any resultant include paths.

If all of the paths are referenced correctly, the fully expanded include folder specification should be visible in the project.lnt file generated by Visual Lint:

// Generated by Visual Lint 1.5.7.79 from file:
// C:\Projects\VsPropsExample\VsPropsExample.vcproj
// -dConfiguration=Debug|Win32
//
-D_UNICODE;UNICODE // CharacterSet = "1"
-DWIN32;_DEBUG;_CONSOLE // PreprocessorDefinitions = "WIN32;_DEBUG;_CONSOLE"
-D_NATIVE_WCHAR_T_DEFINED // TreatWChar_tAsBuiltInType = "TRUE"
-D_MT;_DEBUG;_DLL // RuntimeLibrary = "3"

// AdditionalIncludeDirectories=
""C:\Projects\VsPropsExample\Include2\""
-i"C:\Projects\VsPropsExample\Include2"


VsPropsExample.cpp // RelativePath = "VsPropsExample.cpp"
stdafx.cpp // RelativePath = "stdafx.cpp"
One important caveat to note is that this process can only work if Visual Lint is configured to write the project.lnt files itself (the default). If PC-Lint is being used to process the .vcproj files it will (as far as I am aware) ignore the .vsprops files and thus any additional includes defined within them will not be reflected in the analysis configuration.

To check whether this option is correctly set, open the "Visual C++" page within Visual Lint Options:

Setting the 'Override PC-Lints generation of project.lnt files' option ensures that Visual Lint writes project.lnt files directly. This is required if you define additional include definitions within .vsprops files.

Posted by Anna at 11:43 | Get Link