Version 2 (modified by tuan kuranes, 7 years ago) (diff)


Code quality checking tools

This page is a random assortment of ideas and tools for improving quality (detecting potential bugs etc). It doesn't include things that are run automatically (like most compiler warnings). Most things are not supported on all OSes.

Dehydra static analysis checks

ps/trunk/build/dehydra has some scripts to check for specific bugs (currently argument type-checking in (w)printf-style functions).


Run the tests or the game or Atlas in Valgrind, to get reports of uninitialised memory and leaks and so on. The code should run cleanly with no errors (though there may be errors reported in drivers which you need to ignore). Valgrind is really really slow, so we probably ought to have some way to record real-time inputs and play them back at Valgrind speeds, but we don't really have that now.

GCC warnings

  • -Wstrict-overflow=5 - some discussion here. Only gives useful output in optimised builds (CONFIG=Release make). Warns about cases where the compiler optimises based on assumptions that signed overflow never happens; our code should be certain those assumptions will not be violated. (There are lots of false positives so the warning isn't on by default).


  • free, fast and simple to test, no false positive, from bugs, memory and optimization checks, really mandatory to run on all cpp source cppcheck