Comment 2 for bug 744595

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

I initially thought this had been posted in the forum, so my comment is probably a bit more off-topic than it could have been.

Anyways, I recently discovered that clang* has a static code analyzer built-in, which we might want to take advantage of. For those unfamiliar with static code analyzers, they will basically go through the source code and look for error patterns. This allows developers to notice and fix issues before they become serious bugs. I haven't tried it on widelands myself, but I think someone should at least take a look to see whether it reports any issues which should be fixed.

Some links I've been reading lately for more background information:
http://grep.be/blog/en/computer/code/static_analysis_with_clang (example of issue found by static code analysis)
http://altdevblogaday.com/2011/12/24/static-code-analysis/ (Carmack's thoughts on static code analysis. One highlight I especially liked was "This seems to imply that if you have a large enough codebase, any class of error that is syntactically legal probably exists there.")

*It also looks like Visual Studio includes one, so we might want to look at that for Windows as well.