Dehydra is a lightweight, scriptable, general purpose static analysis tool capable of application-specific analyses of C++ code. In the simplest sense, Dehydra can be thought of as a semantic grep tool.

Dehydra presents a wealth of semantic information that can be queried with concise JavaScripts. It is also useful to find bugs in source code as it allows for much more error checking than C++ is capable of by itself. Dehydra is built as a GCC plugin, thus it is easy to use for projects that already support GCC.

Dehydra is also useful for generating language bindings and is used to bootstrap Treehydra, a heavy-duty static analysis GCC plugin.

Usage:

Dehydra checking can be performed directly within the Mozilla build. To enable static checking of a Mozilla build, see Building with static checking.

To run Dehydra manually using G++, add the -fplugin and -fplugin-arg flags to specify the location of the Dehydra plugin and the location of the analysis script: