Confessions of a Wall Street Programmer

practical ideas (and perhaps some uncommon knowledge) on software architecture, design, construction and testing

Static Analysis Helper Scripts

A few scripts that can be helpful in the use and evaluation of C++ static analysis tools.

Script Description
build_cppcheck.sh Script to build cppcheck for installation in a non-standard location (i.e., not /usr, /usr/local).
cc_driver.pl Iterates over a compilation database (compile_commands.json) file, and executes a specified command for each build target, passing the compiler flags from the normal build.
cppcheck.sh Invokes cppcheck defining a number of common parameters, also generates and includes compiler pre-defined macros.
cppcheck2csv.pl Takes (filtered or un-filtered) output from cppcheck, and formats it in csv format.
clang2csv.pl Takes (filtered or un-filtered) output from clang tools (clang-check and clang-tidy), and formats it in csv format.
itc2csv.pl Takes a list of error annotations from ITC benchmark suite, and formats it in csv format.
pvs2csv.pl Takes a list of error annotations from PVS-Studio, and formats it in csv format.
run_pvs.sh Example script used to run PVS-Studio against ITC benchmarks.


Most of the scripts are written in Perl, simply because that was easiest (especially given the excellent debugging support available under Eclipse with EPIC). Plus, I kind of like Perl, as I’ve mentioned before.

The scripts have been tested on CentOS 6.

Comments