clangify2010: Using the Analyzer with Visual Studio 2010

The Clang Static Analyzer has only limited support right now for Visual Studio users. Some users might find the Clangify2010.py script useful (described below) for analyzing their projects. It does not provide the same functionality as scan-build (for example, it does not actually build Visual Studio projects to analyze source files nor does it have a UI for viewing results) but some users may still find it useful.

We encourage anyone who is interested in developing support/integration of the Clang Static Analyzer with Visual Studio to get involved in clang development.

Important Caveats

Requirements

Usage

Step 1: Download the script

Assuming you have met all of the above requirements, you should first download and copy clangify2010.py to wherever your project resides. Alternatively you can put the script in a global location and add it to your PATH.

Step 2: Running the script

Once you have obtained clangify2010.py say you have a project file called Foo.vcxproj, holding 300 .cpp files. To run the analyzer on all these files, just type the following at the Windows command prompt:

clangify2010.py Foo.vcxproj

clangify2010.py will automatically scan your project file for all your C++ files and hand them off to the Clang Static Analyzer for analysis.. Additionally, you could run the script as a post-build step to your project.