Static code analysis

"René J.V. Bertin" rjvbertin at gmail.com
Thu Jun 5 22:28:55 BST 2014


On Jun 05, 2014, at 22:30, Boudewijn Rempt wrote:

>> Prepare yourselves to scan through a lot of output! :)
> 
> Did you do that for calligra? Anything we need to fix asap?

No, I said "on my own code", didn't I? :)

I did just verify what I said about the scan-build script on a KDE-related cmake-based project (oxygen-gtk2). While I was right it doesn't seem to work well with such projects; it modifies $CC and $CXX and those variables aren't used by cmake. You'd have to use a wrapper script that adds at least -DCMAKE_CXX_COMPILER=${CXX} to the cmake arguments, and call that wrapper AND the subsequent make call through scan-build. (I can provide such a wrapper if you like.)
Alternatively, just set the compiler to clang and add --analyze to its arguments in a separate directory if you prefer to separate analysis and building (and be certain which compiler is used for that) but you lose the nice report presentation in the browser that you get with scan-build's -V option.

René


More information about the calligra-devel mailing list