Re: Sequence points



In article
<b8ef0b4f-c554-4739-abfd-bc748ae5f548@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
spinoza1111 <spinoza1111@xxxxxxxxx> writes
Furthermore, the evaluation order between
consecutive sequence points with respect to ordinary operations tracks
precedence. It is not "up to the implementor".

Wrong once again.

Given:

int f (int v, char *fmt) { printf (fmt, v); return v; }

the code extract:

int a, b = 5, c = 11, d = 7;

a = f (b, "B = %d\n") + f (c, "C = %d\n") * f (d, "D = %d\n");

is well-defined, will set a to the value 82, and will print the three
lines:

B = 5
C = 11
D = 7

but it may print them in any of the 6 possible orders.

You aren't even consistent yourself: sometimes you want expressions done
left-to-right (so it would print B, C, D) and sometimes you want to
follow operator precedence (which would put B last).

had a
Harvard degree in mathematics and was the Socialist Workers party
candidate for governor of Illinois.

Is either of those supposed to impress us?

The results of this criminal dishonesty are on display in Beautiful
Code in which the reader is expected to know bad practice (the
usability of value parameters)

It's not bad practice, it's an idiom of the language. Nobody is asking
you to use it, but if - as you claim - you taught C but didn't teach
that it was possible, you did your students a disservice.

You could be a hardass on the order of a
Wirth and insist that p++, as a legacy mistake,
Begging the question. It has not been demonstrated that post-increment is a
mistake, legacy or otherwise.
It had insufficient justification. What part of p = p + 1 don't you
understand? It's the compiler's job to optimize push p, increment,
store p to an in-memory operation that bypasses the stack.

Today, perhaps. Thirty years ago, harder to argue.

But as an idiom, an expression containing "p++" can often be easier to
grok than one where "p = p + 1" has to be added separately. Particularly
in cases like "*p++ = *q++".

Translation: you screwed up because you didn't understand how evaluation
order works in C, and now you're claiming that it's a safety issue because
there might be other people using C who are as bad at it as you are. Well,
maybe that's possible - stranger things have happened - but C was designed
for use by skilled programmers. Sharp tools have sharp edges, by
definition. Don't run with scissors.

Hear! Hear!

Screw you, you patronising and half-educated son of a bitch.

Oh dear, he's losing his temper. Clearly he lacks any substantive reply.

I've used
C as I have said, and no man can force me to use a tool which I
determined, even before the standard, was inadequate based on my prior
to experience, in rapid succession, with machine, assembler, Fortran,
PL/I, Algol, Cobol, Rexx, and Pascal because I believe in computing
humanism and I don't worship machines.

Yada yada. I've programmed in all of those apart from Rexx, and I could
add another half-dozen. All before I learned C.

I don't sit in my *** and whine about incompetent software
maintenance by people who have a right to expect operators to be
executed in a sensible order, or, at a minimum, an option (that is not
provided) to do so.

No, but you do whine because the designers of a language didn't agree
with the opinion of the Great God Schildt and his Prophet Nilges.

Right - all you have to do is leave C alone and let C programmers get on
with using it.
They are engaged in mail fraud, among other activities.

"mail fraud"?

I ask again that you STOP BOTHERING
ME.

Then stop misrepresenting me and lying about what I said.

Under separate cover and by email I have advised Clive Feather to not
post here,

My email logs show no email from you (and I checked the spamtraps). If
you sent one, please cite the message ID or some other information I can
use to track it.

since he's unaware, as is Julienne, of the Lynch mob
dynamics of a bunch of hobbyists and incompetents and so in a state of
confusion at this time.

The only confusion I have is how somebody with your claimed history can
be so deluded, rude, and arrogant.

I don't think Herb Schildt understood what was going on in the
standard.

Unwittingly, you have spoken the truth at last: Herbert Schildt did indeed
fail to understand the Standard.

But if he had, and had explained it properly, there might

...have been much less reason to criticise his C writings.

I note there's no response to this. Presumably because it's true.

--
Clive D.W. Feather | Home: <clive@xxxxxxxxxx>
Tel: +44 20 8495 6138 (work) | Web: <http://www.davros.org>
Fax: +44 870 051 9937 | Work: <clive@xxxxxxxxx>
Please reply to the Reply-To address, which is: <clive@xxxxxxxxxx>
.