On 2/24/10 19:12 , "Mike Shal" <mar...@gmail.com> wrote: > On 2/24/10, Jean-Denis Muys <jdm...@kleegroup.com> wrote: >> >> On 2/24/10 9:36 , "Simon Davies" <simon.james.dav...@googlemail.com> wrote: >> >>> Rogue semicolon on line >>> >>>> if( sqlite3_close( db ) != SQLITE_OK ); >>> >>> Regards, >>> Simon >> >> >> I have been bitten by such silly mistakes often enough! >> >> This is why I have switched to a compiler with sanity checks. On this line >> of code, it warns: >> >> "if statement has empty body" >> >> This compiler is llvm. Check it out at http://llvm.org >> You can test for this mistake on the demo page at http://llvm.org/demo >> > > What compiler were you using before? Gcc warns about this too, though > you have to explicitly enable the warning using -W (or -Wempty-body > for just that particular warning). > > I suppose you could argue whether or not it's right to have that > warning on by default, but I've found warnings are generally a matter > of personal preference. If you don't make spurious semicolon mistakes, > you probably don't need that warning on. I make tons of such mistakes, > so I use a variant of the BDECFLAGS. That helps catch most of the > stupid things I do :) >
I yes I switched from GCC, but not for that particular warning. The three features of LLVM/Clang technology that won me over are the generally much better error messages, link-time optimization and the static code analyzer. In any case, though I did not make any claim regarding its handling of this issue, I stand corrected on GCC. And yes I do try to keep warnings on as much as possible. Jean-Denis _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users