1
0
forked from 0ad/0ad
0ad/build/dehydra
2009-11-07 13:38:31 +00:00
..
tests An initial Dehydra-based static analysis script for type-checking printf-style functions 2009-11-06 22:48:11 +00:00
printf-type-check.js Fix inconsistency in Dehydra script 2009-11-07 13:38:31 +00:00
README.txt An initial Dehydra-based static analysis script for type-checking printf-style functions 2009-11-06 22:48:11 +00:00

Dehydra is a tool that allows custom static analysis of C++ code, with analysis code written in JavaScript, running as a GCC plugin.

This directory has some analysis scripts. The setup is a bit ad hoc and not well tested or integrated into the build system or anything, so use at your own risk.

General usage instructions:

 * Run Linux. (It might work on OS X too.)

 * Install Dehydra, as per https://developer.mozilla.org/En/Dehydra/Installing_Dehydra

 * Build 0 A.D. from build/workspaces/gcc:
    export CXX="$HOME/gcc-dehydra/installed/bin/g++ -fplugin=$HOME/gcc-dehydra/dehydra/gcc_treehydra.so -fplugin-arg=../../dehydra/printf-type-check.js -DCONFIG_DEHYDRA=1"
    make
    # (or "make test -j3 -k" to build the engine and tests and to do 3 files in parallel and continue past errors, etc)

 * Wait (it's quite slow) and look for the new compiler warnings/errors.

The "tests" directory doesn't actually contain any proper tests, just some example files and expected outputs for rough sanity checking.