![](https://secure.gravatar.com/avatar/ca2f70e2d8f170737606b4b740d91a92.jpg?s=120&d=mm&r=g)
13 Nov
2013
13 Nov
'13
10:58 p.m.
Hi All,
Has anyone played around with the Clang analyzer much [1]? I gave it a quick run last night, and it picked up a few hundred potential issues in our code. At first glance, a lot of them are probably harmless, but the tool is very good at highlighting places where we could be referencing NULL pointers or using uninitialised variables.
Even when we "know" that the highlighted code is safe (e.g., pointers have implicitly been checked before referencing), we can add assertions to make the safety explicit. Here's an example [2]
I'd strongly recommend that we make use of this tool!
AV
[1] http://clang-analyzer.llvm.org/scan-build.html [2] http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/12798