[Wiltshire] Static analysis tools

Andrew Meredith andrew at anvil.org
Mon Jul 13 13:17:48 UTC 2009


David Fletcher wrote:
> Does anybody use these?
> 
> I just tried running cppcheck on a set of source I know to contain a horrible 
> little bug but it only produced two lines of output, totally unrelated to the 
> problem. If I tell it to include style checking it produces a decent quantity 
> of output, but still nothing related to the problem.
> 
> Dave

Sadly it probably means it's a logic bug or coding bug, not something
the compiler FUBARed.

Try looking for tight little knots of code, commenting them out and
re-expressing them in a longer more laid out form. Sometimes you can see
the same thing 1000 times and read it the same way 1000 times and it'll
actually mean something else entirely. Re-expressing what you know you
want in a different way can force the issue and allow the code to work.
This will then focus the mind on that exact expression, but now with the
expectation that it is wrong. Daylight will dawn.

Been there .. hope it works for you too

Andy M





More information about the Wiltshire mailing list