Mike McCormack wrote:
Andreas Mohr wrote:
Could you perhaps create a first version of a shell script tools/find_gotchas ?
I have other things to do at the moment, so go ahead if you're feeling motivated. I suspect you'll run into alot of false positives. There might be a compiler switch to turn on warnings for these things too (ie. statements with no effect).
Gcc-4.0 catches this:
erikd@miles > cat test.c int main (void) { if (0) ; return 0 ; } erikd@miles > gcc-4.0 -W -Wall test.c -o /dev/null test.c: In function 'main': test.c:3: warning: empty body in an if-statement
Erik