On Sat, Sep 24, 2011 at 3:17 AM, Richard Hipp <d...@sqlite.org> wrote:

> The object-code branch coverage testing of SQLite clearly fulfills
> guidelines a, b, c, d, and e.  The question at hand is does 100% branch
> coverage fulfill f in a short-circuit language such as C/C++.  Note that
> the
> paper above completely ignores this issue.  It is as if the authors had
> never heard of short-circuit evaluation.  Or, perhaps they are familiar
> with
> the problem but could not reach agreement on its solution so simply didn't
> bring it up.
>

Maybe this is naive, but what about the definition of constant vs
non-constant? The list describes non-constant bool expressions as having to
be evaluated with both outcomes.

e.g.

char * x = ...; //user-supplied/non-constant

if( x && *x ) {...)

i would argue (naively, perhaps) that the second expression is const be
cause once the value of x is set, the value of *x cannot change so long as x
does not change. But that comes down once's definition of const. *x _as an
expression_ does not exist until it is tried, and it cannot (in
short-circuit logic) be tried until x evaluates to true (else undefined
behaviour, as described earlier).

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to