First of all, all is free software. Here is a list of tools I use for that purposes:
* Static Code analysis:
- cppcheck, there is nothing better!!!!
- the less known G++ option switch: -Weffc++
- gdb with ddd as frontend
- valgrind (includes a lot of tools for all kinds of memory checks and a fantastic profiler)
- zzuf to fuzzy test and detect this way bugs, which would stay long unrecognized
- cxxmetrics if you just need to check quickly basic metrics like LOC, Comment/code ratio, etc. (part of the KDEsdk subpackage, but a command line tool)
- CCCC for full metrics
That tools cover almost all topics aside from developing and I could not live without them.
One of the main purposes of Clang is to double as a compiler and a static code analyzer.
About Valgrind, you should be aware that it's only available on Linux. If Linux is not your main development platform, that's one good reason to always keep a) a Linux installation at hand, and b) your code as portable as possible, so it can be easily ported to Linux.