Re: [sqlite] unreached code in sqlite3.c?

2015-02-13 Thread R.Smith
On 2/13/2015 9:57 AM, Dominique Devienne wrote: 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

Re: [sqlite] unreached code in sqlite3.c?

2015-02-12 Thread Dominique Devienne
On Thu, Feb 12, 2015 at 8:39 PM, Tim Streater wrote: > On 12 Feb 2015 at 19:14, R.Smith 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 > >>

Re: [sqlite] unreached code in sqlite3.c?

2015-02-12 Thread Eric Minbiole
> 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. Per the original post, I believe that the warning was expressly enabled using the [-Wunreachable-code] compiler

Re: [sqlite] unreached code in sqlite3.c?

2015-02-12 Thread Tim Streater
On 12 Feb 2015 at 19:14, R.Smith 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

Re: [sqlite] unreached code in sqlite3.c?

2015-02-12 Thread R.Smith
On 2/12/2015 8:50 PM, Doug Currie wrote: On Thu, Feb 12, 2015 at 1:35 PM, R.Smith wrote: Now one could argue the warning should not be issued for it, or some warnings are fine as information. Personally I prefer zero unneeded warnings/clutter but that's just my pedantism.

Re: [sqlite] unreached code in sqlite3.c?

2015-02-12 Thread Doug Currie
On Thu, Feb 12, 2015 at 1:35 PM, R.Smith wrote: > > Now one could argue the warning should not be issued for it, or some > warnings are fine as information. Personally I prefer zero unneeded > warnings/clutter but that's just my pedantism. > My pedantism is to prefer the

Re: [sqlite] unreached code in sqlite3.c?

2015-02-12 Thread R.Smith
On 2/12/2015 4:58 PM, Doug Currie wrote: Well, if TERM_VNULL is 0, then the code is truly unreachable, so I wouldn't call it a compiler bug. e The point is that TERM_VNULL is controlled by a compiler pre-processor switch and is only unreachable for specific values of that switch - hence if

Re: [sqlite] unreached code in sqlite3.c?

2015-02-12 Thread Doug Currie
Well, if TERM_VNULL is 0, then the code is truly unreachable, so I wouldn't call it a compiler bug. e On Thu, Feb 12, 2015 at 9:26 AM, Richard Hipp wrote: > Dan is right. I think I'd calling this a clang bug. > On Feb 12, 2015 9:06 AM, "Dan Kennedy"

Re: [sqlite] unreached code in sqlite3.c?

2015-02-12 Thread Richard Hipp
Dan is right. I think I'd calling this a clang bug. On Feb 12, 2015 9:06 AM, "Dan Kennedy" wrote: > On 02/12/2015 09:02 PM, Jens Miltner wrote: > >> Hi, >> >> I'm getting the following two warnings when compiling sqlite3.c with the >> latest clang tools: >> >>

Re: [sqlite] unreached code in sqlite3.c?

2015-02-12 Thread Dan Kennedy
On 02/12/2015 09:02 PM, Jens Miltner wrote: Hi, I'm getting the following two warnings when compiling sqlite3.c with the latest clang tools: sqlite3.c:116769:39: warning: code will never be executed [-Wunreachable-code] if( pTerm->wtFlags & TERM_VNULL ) continue;