Erik de Castro Lopo <mle+s...@mega-nerd.com> writes: > Daniel Pittman wrote: > >> You do mean, specifically, bugs that have the appropriate sparse tests >> and/or type annotations in place, right? > > Possibly not. Remeber I played with Sparse for all of 10 minutes.
I wasn't sure how much time you spent investigating it. :) >> Can you render them down to a trivial example that demonstrates the >> failure? > > Well a trivial example: > > int pos, array [100] ; > read (fd, &pos, sizeof (pos)); > array [pos] = 0 ; > > I know analysis tools like coverity can find stuff like this. *nod* I don't think that is one of the problems that sparse tests for[1], in large part because GCC already has a warning for use-without-initialization and sparse tends to be "things GCC can't test". In the bigger picture, your original question about static analysis tools for C missed one critical detail: what do you actually want it to statically analyse? After all, sloccount is technically a static analysis tool for C, but the only thing it outputs are line counts and estimates for time and dollar-cost to reproduce the software — so, probably not what you are after. :) Regards, Daniel Footnotes: [1] ...though I confess to not looking at it in the last few months, so the most bleeding edge version may have changed this. _______________________________________________ coders mailing list coders@slug.org.au http://lists.slug.org.au/listinfo/coders