Clang’s static analyzer (description and more detailed information about setting it up here and here) is an wonderful tool that helps catching some nasty bugs and that has not been widely divulged so far. Lately we’ve been using it to help debug the Enlightenment Foundation Libraries (EFL), and I decided to post this just to help other people try it out.
In order to use it, basically one just needs to get both llvm and clang (preferably from svn, since these tools are being updated all the time) and install them somewhere on the PATH, and afterwards use the scan-build script to build the application/library you want to analyze.The output is a nice set of html files, with the reported bugs divided by type and with detailed information + commented source code.
I’m trying to maintain updated reports on the EFL here, using a really simple script that I made to compile some of the most important libraries, apart from E itself. The script is also available on the same URL, in case someone wants an easy way of trying this out.
I didn’t understand the jump from building it with clang+llvm and it finding bugs. What are those html files it generates? Does it “find bugs” in the sense that it has warning and error messages besides those from gcc?