On Thu, Feb 12, 2015 at 8:39 PM, Tim Streater <t...@clothears.org.uk> wrote:
> On 12 Feb 2015 at 19:14, R.Smith <rsm...@rsweb.co.za> wrote: > > On 2/12/2015 8:50 PM, Doug Currie wrote: > >> It's easy enough to fix if you want 0 to be a valid value for > TERM_VNULL: > >> > >> #if TERM_VNULL > >> if( pTerm->wtFlags & TERM_VNULL ) continue; > >> #endif > > > > Agreed, but how easy it is to fix a problem that is not a problem is > > kind of irrelevant... We should write code to make systems execute > > efficiently and correct, not to make compilers shush. > > If the statement will never be executed the compiler should simply > optimise it away. No warning is necessary unless you turn on some flag that > highlights such optimisations. > Warnings are always a tradeoff between pointing out what could be mistakes/oversights versus senseless noise. Most times I get the unreachable warning in my code is when I'm actively coding, experimenting, moving things around, then when I'm done I silence them one way or another. Not 100% sure (I don't use Clang day to day), but I think I remember reading that one way to silence this Clang warning is via extra parens, if ((bool-test)) { ... }. You're telling Clang "this one's not an oversight, thank you". Small enough concession to having useful warnings in other places, no? Certainly less ugly than using the preprocessor IMHO. My $0.02. --DD _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users