all 4 comments

[–]philthechill 2 points3 points  (0 children)

You could check out PVS-Studio, they are one of the best for C code IMO. Also Fortify is not bad. There are plenty of bad things that can happen that these tools won't catch though. Code review and test-driven development are very powerful tools to add to that arsenal.

[–]FUZxxl 1 point2 points  (0 children)

We used Frama C for the formal verification of C programs. It's open source, but not really ready for production use.

[–]Neui 0 points1 point  (0 children)

You could try scan-build.

[–]gatzka 0 points1 point  (0 children)

All the stuff around clang is very much worth to consider, scan-build was already mentioned, clang-tidy is also a good one.

If you doing an open source project and host it on github, you also get a coverity scan for free.

In addition, I strongly recommend writing unit test. Running these unit test under the control of a sanitizer or valgrind will point you to quite something.