Our Emperor Sponsors

  • InternetNZ
  • Google
  • IBM
  • HP

<-- Back to schedule

The Hydras: Improving the C/C++ Development Experience via GCC Static Analysis Plugins

Time:11:30 - 12:15
Day:Thursday 21 January 2010
Location:Renouf 1 (MFC)
Project: Dehydra

Historically, it has been hard to analyze C++ source. C++ is hard to parse, there are no complete open source parsers other than G++. As a result most C++ analysis tools are as sophisticated as grep. Unfortunately, even if one can parse the language it is usually inconvenient to plug in an analysis tool with a custom parser into a project build system. This may be the reason that even C analysis tools such as sparsify are not widely used.

Frustrated with inability to analyze our Mozilla code and after running into a dead-end with a non-GCC C/C++ parser (Elsa), we built our static analysis tools on a custom plugin framework on top of GCC. Using GCC enables one to easily integrate static analysis into any build system that uses GCC: a matter of adding a few compiler flags.

Recently, FSF made a license change allowing third-party plugins in GCC. This will make it possible for anyone using GCC 4.5 to analyze their code by installing analyses passes via compiler flags.

This talk is about the new dimensions of development opened by being able to analyze the semantic structure of one's code using the Dehydra/Treehydra plugins developed at Mozilla. I will describe how open source static analysis can make it easy to query/visualize your source code, enforce APIs and prevent certain patterns of bugs. Getting a firm grip on C/C++ codebases has never been this easy.

Taras Glek

Taras Glek is a static analysis hacker at Mozilla. Unlike most Mozilla hackers he rarely works on Mozilla code directly. Taras spends most of his time on C++ static analysis and refactoring toolchains that can do a lot of the large-scale mechanical C++ tasks for him.

Taras maintains Dehydra, Treehydra and Pork projects at Mozilla. He contributed parts of the GCC plugin framework.