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 :)

-Mike
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to