[Wiltshire] Static analysis tools

John Larkworthy john_larkworthy at yahoo.co.uk
Mon Jul 13 14:18:08 UTC 2009


Dave,

GCC does a pretty good static check particularly if you use the -Wall option. It will report on apparent use of uniitialised variables which may not be your problem. Things like stack overflow or reading beyond array bounds are usually trapped using dynamic checkers such as valgrind. This would probably mean you need a test harness to drive the code through all paths to reveal the nasty little bug. 

Actually writing a harness and excuting under gdb/ddd will probably allow you to single step through the code and discover the logical error.

John.



--- On Mon, 13/7/09, David Fletcher <dave at thefletchers.net> wrote:

> From: David Fletcher <dave at thefletchers.net>
> Subject: [Wiltshire] Static analysis tools
> To: wiltshire at mailman.lug.org.uk
> Date: Monday, 13 July, 2009, 1:25 PM
> 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
> 
> _______________________________________________
> Wiltshire mailing list
> Wiltshire at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/wiltshire
> 


      



More information about the Wiltshire mailing list