James Dow Allen said:
[snip] ; [snip]
Semi-colon. Less well known, perhaps, than the Comma "sequence point"
but it also serializes.
; does not mean there is a sequence point. For example, there is no
sequence point in
break;
nor in
continue;
foo(a++ + a++)
gives undefined behavior; one could say that's because a needed
sequence point is missing. In this way, the concept "sequence
point" becomes meaningful.
Is there an example program where saying " 'continue;' lacks
a sequence point" is meaningful? That is, where the same
program could give different results *because* of that "missing"
sequence point? I can't think of one; maybe I'm lacking
imagination.
I can't either or I would have included one! I don't think there is
one. My point was only about how C is specified.
OK. We seem to be in agreement that the "lack of a sequence point"
in "break;" or "continue;" is a concept which lacks any meaning
except in the context of a literary review of The C Standard(tm).
Out of curiosity, would you also concede that it is difficult or
impossible to imagine a C compiler(Note 1) which handles
if (setjmp((a, b), c))
properly but mishandles
if (a, setjmp(b, c))
(Note 1: Obviously we exclude compilers which go out of their way
to deliberately mishandle the latter in the spirit of the villain
in the Nicholas Cage movie _8MM_, "just because they could.")
FWIW, James never had a reputation for lackadaisical or imprecise
thinking. I've been consulted by experts to explain the detailed
operations of certain machines. For some reason the mechanisms
whereby 1-bits change to 0-bits in real hardware has intrigued me
in a way that studying whether The Standard(tm) has inconsistencies
in its discussions of commas and semi-colons does not.
Recently I was corrected for suggesting that
p += 0;
might be a no-operation when p is a null pointer.
I immediately thought "Aha!"; perhaps some machines with
1's-complement arithmetic use negative-zero as the null-pointer
representation; adding zero to it flips it to positive-zero
and no longer null -- that's probably why.
Yet, although 2 or 3 people spoke up to clarify The Standard(tm),
no one thought c.l.c'ers had the intellectual curiosity
to wonder *why* (p += 0) might not work on some machines.
I'm retired now, but *loved* C when I was an active programmer.
If I were starting out today, I might have to look elsewhere
for a programming language whose culture suits my temperament.
James Dow Allen