Clang static analyzer

Tomas Carnecky tom at dbservice.com
Sat Dec 5 12:15:58 PST 2009


During the past two days I played with the clang static analyzer. Clang is a C/C++ compiler based on LLVM. The clang static analyzer makes use of clang and the LLVM infrastructure to perform static analysis on C source code. I wrote a blog post [1] about my experience with it so far.

I tested the static analyzer on a few opensource projects, one of which was the xorg xserver. The results (333 potential bugs) are available on my web server [2]. I skimmed only quickly over the results and they need careful review to find out which ones are actual bugs. Some of the issues are very easy to review (dead assignments, dead increments), others not so much.

I could run the analyzer on other parts of the xorg stack (mesa, drivers, libraries) if there is interest.

[1] http://caurea.org/2009/12/05/using-the-clang-static-analyzer-under-linux/
[2] http://78.46.209.101/stuff/clang-static-analyzer/xorg/xorg-server-1.7.99.1-112-gbb7acfb/


More information about the xorg-devel mailing list