Valgrind is, to quote the website, " an award-winning suite of tools for debugging and profiling Linux programs".
It truly is an amazing tool for running against your code base to detect all manner of problems, from memory leaks to 64-bit porting problems.
I really can't rate it highly enough, it is a wonderful tool. Read more about it here : About Valgrind. It's one of the best tools you will find for checking your code.
Version 3.2.0 supports 32-bit x86/Linux & PPC32/Linux and now also 64-bit AMD64/Linux and PPC64/Linux.
You mainly place it in front of your program when running to analyse it.
For example :
$ valgrind my_program my_args
Static source code analysis
HP have released a good free tool for analysing source code. It's the HP Code Advisor, or cadvise (c advise). It's a static analysis tool for checking C and C++ source code. To use it you would run it like this :
$ cadvise cc -my_compiler_opts source_code.cand it reports on potential porting problems, coding errors, security risks, etc.
Version 1.1 is up on their website now.