sequence points in subexpressions

F

Flash Gordon

Kenneth said:
You don't see any sequence point between "i++" and "+i" here?
Nope.

i = (i, i++, i) + i;
^ ^
here and here

I saw those sequence points, and can still see them, but they are not
between the i++ and the i. The reason being there is no sequencing
between the (i, i++, i) on one side of the + and the i on the other
side, so they could be interleaved. so if we number the i's as shown
below...
i = (i, i++, i) + i;
1 2 3 4 5
it could be evaluated in the order
i2 i3++ i5 i4
This gives no sequence point between i3++ and i5. I believe the draft of
C1x makes it clear that if any valid ordering leads to undefined
behavior then the behavior is undefined.
 
K

Kaz Kylheku

I disagree.
I know that the value of (i,i++,i) is one greater
than the original value of (i).
I computed that without accomplishing any side effects.

You /must/ be trolling.

Computing the value of (i, i++, i) is /mathematically/ impossible without
modelling the side effect of i++, and reconciliation thereof by the comma
operator's sequence point.

Without the help of that sequence point, the final rightmost i does not
reliably refer to the incremented value.

You cannot reduce the expression to a stable value without taking into account
the sequence points and modeling them faithfully in your evaluation.

In your evaluation model, you must instantiate a representation of the object
i, and then perform the side effect upon it. There are no magic shortcuts.
 
K

Kaz Kylheku

I'm not evaluating the lone (i) which follows,
because I'm not evaluating the expression which contains it.

The meaning of the phrase "evaluate an expression" is at issue here.

If an expression has side effects,
then merely calculating its value,
is not an evaluation of the expression.

Who said that it was? Beej said above ``for the value computation
.... to be complete, i++'s side effects must be complete''.

That is true, and value computation is not evaluation.

An expression can leave pending side effects, even though its value is already
known.

However an expression which contains a sequencing operator cannot
announce its value without having completed those side effects
which lie on the other side of that operator.

Given (A, B), we can know the value of the expression (derived from B) before
the expression is fully evaluated. Both A and B may have side effects. At the
time when we know the overall value of the expression, the side effects of A
are done and dusted. Those of B are not necessarily done.
If you had to evaluate the right operand of every assignment operator
before making the assignment,

Compeltely irrelevant, because in this debate, the issue is that
the right hand side contains a comma operator which provides the
sequencing.

Nobody is claiming that the assignment operator has a sequence point (which
would make expressions like i = i++ defined).

You're constructing something worse than a strawman; this is not a weakened
version of the position held by your debate opponents, but a completely
different position.

Your topic-shifting trolling tactic is 100% transparent at this point.
 
J

Johannes Schaub (litb)

Kaz said:
You /must/ be trolling.

Computing the value of (i, i++, i) is /mathematically/ impossible without
modelling the side effect of i++, and reconciliation thereof by the comma
operator's sequence point.

Without the help of that sequence point, the final rightmost i does not
reliably refer to the incremented value.

You cannot reduce the expression to a stable value without taking into
account the sequence points and modeling them faithfully in your
evaluation.

In your evaluation model, you must instantiate a representation of the
object i, and then perform the side effect upon it. There are no magic
shortcuts.

In C99, it's totally irrelevant that there is a sequence point after "i++",
because the evaluation of the assignment expression ("i = (i, i++, i)") is
not after that sequence point, but it's *around* that sequence point: The
sequence point after "i++" is a part of the assignment expression (namely,
it appears in evaluation of its right side here).

As such, the Standard does not enforce that the assignment side effects does
not appear between the same pair of sequence points (and it doesn't even
agree the side effect is complete before any of the sequence points within
any of its operands). It only has to be complete at the full expression
sequence point. So, since we now have the value of the scalar changed
between the previous and the next sequence point more than one time
potentially (depending on how the implementation schedules the side
effects), we are running into UB.
 
S

spinoza1111

...


Indeed.  Well put.  ITA.

But the point is that that is precisely the stock-in-trade of this
newsgroup.  As I have shown many times, it is not possible to post
anything to this newsgroup, that will meet the generally accepted
standards of "appropriateness", that is not either a) a topicality flame
(gotta love them!) or b) language lawyering, of the type that is of no
interest to the vast majority of working C programmers.

Your post hits the nail on the head as to the sort of thing that people
like Kiki, et al, just salivate over, but the rest of us find dull and
uninteresting at best, and downright offensive at worst.

I think the problem is that too many posters are basically sitting
around companies in which actual programming is no longer performed,
and instead the "programmers" plan meetings to discuss the plan for
the next meeting to discuss the agenda for the end of year
meeting...you get the picture. Or they find what seem to be bugs and
then zip them over to Ulan Bator where the compiler experts, who are
genuinely intelligent and well trained, fix the problems.

In this environment, the topic *du jour* is a dull personal resentment
that dare not seek a constructive, if risky outlet. How much easier
and safer it must be to "laugh at" people with hearts and brains and
dicks, like Herb Schildt.

I mean, look at our "moderator" of comp.lang.c. Guy can't even be
troubled to email a poster who's made an error asking him wtf,
although THIS IS THE MODERATOR'S JOB. Instead, he allows an innocent
third party to get embarassed because he "volunteered" to moderate in
order to seem qualified, having not bothered to take a single computer
science class.

I conclude that American and developed countries have a sort of drone
class that constitute the recipients of an unnamed form of welfare.
That is, technology has in fact evolved to the point where, if we
factor out admittedly serious environmental impacts, only a few actual
workers are needed to keep things going. The rest need the services of
a welfare state but to explicitly offer these services creates
undecidable claims for larger shares of the pie.

Therefore, Job One in the corporation becomes covering up your
incompetence at what you were hired to do by loudly claiming that safe
targets are "incompetent" because, to quote dear Peter, "the 'heap' is
a DOS concept" (chortle).

Language lawyering, and berating people for not returning zero or what
ev er, becomes the train spotting, but it's bullshit, since in
actually advising real questioners, our little language lawyers forget
their lessons, as in a recent post where Kiki forgot to admonish a
questioner for not terminating a printf with a newline, or returning
zero, or declaring a void formal parameter.

It's welfare for white males.
 
S

spinoza1111

In C99, it's totally irrelevant that there is a sequence point after "i++",
because the evaluation of the assignment expression ("i = (i, i++, i)") is
not after that sequence point, but it's *around* that sequence point: The
sequence point after "i++" is a part of the assignment expression (namely,
it appears in evaluation of its right side here).

As such, the Standard does not enforce that the assignment side effects does
not appear between the same pair of sequence points (and it doesn't even
agree the side effect is complete before any of the sequence points within
any of its operands). It only has to be complete at the full expression
sequence point. So, since we now have the value of the scalar changed
between the previous and the next sequence point more than one time
potentially (depending on how the implementation schedules the side
effects), we are running into UB.

In discourse more sweet
(For Eloquence the Soul, Song charms the Sense)
Others apart sat on a hill retired,
In thoughts more elevate, and reasoned high
Of Providence, Foreknowledge, Will, and Fate--
Fixed fate, free will, foreknowledge absolute,
And found no end, in wandering mazes lost.
Of good and evil much they argued then,
Of happiness and final misery,
Passion and apathy, and glory and shame:
Vain wisdom all, and false philosophy!--
Yet, with a pleasing sorcery, could charm
Pain for a while or anguish, and excite
Fallacious hope, or arm th' obdured breast
With stubborn patience as with triple steel.

John Milton, Paradise Lost
 
D

Dennis \(Icarus\)

I mean, look at our "moderator" of comp.lang.c. Guy can't even be

The newsgroup comp.lang.c does not have a moderator.
troubled to email a poster who's made an error asking him wtf,
although THIS IS THE MODERATOR'S JOB. Instead, he allows an innocent
third party to get embarassed because he "volunteered" to moderate in
order to seem qualified, having not bothered to take a single computer
science class.

Surely you're aware that people can learn a subject, and quite well, without
having taken a class, right?

<snip>

Dennis
 
K

Kenny McCormack

The newsgroup comp.lang.c does not have a moderator.

This sort of response is typical "reg BS".
The "scare quotes" that spinoza1111 used around the word should make it
clear (to anyone who wants to understand) that he knew that,
technically/officially, there is no moderator. He was clearly speaking
metaphorically. Equally clearly, several CLC regs have set themselves
up as being the moral equivalent of moderators.
 
D

Dennis \(Icarus\)

Richard Heathfield said:
It is also my experience that some people can /teach/ a subject, and
quite badly, without ever having taken the trouble to learn that
subject. (I had such a teacher on my C course. For example, I had not
only to explain but actually to demonstrate to her that the
controlling condition on a loop is tested only once per iteration,
not after every single statement.) For this and other reasons, taking
a class is no guarantee of learning a subject properly. Nor is it a
guarantee of not learning the subject properly, however.

I guess the key thing for spinoza is that it appear on a transcript.
Whether you actually know the subject or had taken the class but forgot the
material due to the passing years, is irrelevant. :)

Dennis
 
D

Dennis \(Icarus\)

Kenny McCormack said:
This sort of response is typical "reg BS".
The "scare quotes" that spinoza1111 used around the word should make it
clear (to anyone who wants to understand) that he knew that,
technically/officially, there is no moderator. He was clearly speaking
metaphorically. Equally clearly, several CLC regs have set themselves
up as being the moral equivalent of moderators.

And yet, he also said
"troubled to email a poster who's made an error asking him wtf,
although THIS IS THE MODERATOR'S JOB."

It's in the part you snipped away.

If he truly thought there was no moderator, then there's no job to do. Since
he was faulting the person for not doing their job, it's looks like he
thought there was a moderator.

Pretty straightforward, for those who want to understand.

Dennis
 
K

Kenny McCormack

Dennis \(Icarus\) said:
Pretty straightforward, for those who want to understand.

Dennis

Heh heh. You're funny.

I bet they called you "Dennis the Menace" when you were growing up.
 
A

Argonaut

This sort of response is typical "reg BS".
The "scare quotes" that spinoza1111 used around the word should make it
clear (to anyone who wants to understand) that he knew that,
technically/officially, there is no moderator. He was clearly speaking
metaphorically. Equally clearly, several CLC regs have set themselves
up as being the moral equivalent of moderators.


But for anyone who follows comp.lang.c.moderated, it's clear that
Spinoza has confused this group with that, as he recently made a fool
out of himself there when he went for the throat of Peter Seibel.
This was unremarkable, for him, but eventually it became obvious that
he thought this was Peter Seebach. And when even he realised he'd
attacked an innocent person, he blamed the moderator of the group
(Seebach) for not stopping him (of course, if he had, Spinoza would
have been screaming about censorship) and reverted to attacking
Seebach.

Citing him in support of whatever your issues are with "CLC regs" is
not going to gain you any credibility.
 
E

Eric Sosman

It doesn't matter how many times this is said - there remain people
who will never understand or believe it.

What folly will you try to convince us of next? That
there is no cabal?
 
S

Seebs

If he truly thought there was no moderator, then there's no job to do. Since
he was faulting the person for not doing their job, it's looks like he
thought there was a moderator.

Spinoza's often crossposted things between clc and clcm, and of course,
there is a moderator of clcm. Who is, tragically, not omniscient, and
thus cannot always tell whether a particular incoherent rant will later be
alleged to have been an "error".

-s
 
S

spinoza1111

This sort of response is typical "reg BS".
The "scare quotes" thatspinoza1111used around the word should make it
clear (to anyone who wants to understand) that he knew that,
technically/officially, there is no moderator.  He was clearly speaking
metaphorically.  Equally clearly, several CLC regs have set themselves
up as being the moral equivalent of moderators.

This is the case. But I should have said the "moderator" of
comp.lang.c.moderated. Your point is well taken: in the unmoderated
group, some thugs pretend to be moderators.
 
S

spinoza1111

But for anyone who follows comp.lang.c.moderated, it's clear that
Spinoza has confused this group with that, as he recently made a fool
out of himself there when he went for the throat of  Peter Seibel.

People whose business it is to create confusion have themselves to
pretend that they never make mistakes. But the way they do this is by
never being creative or helping others.
This was unremarkable, for him, but eventually it became obvious that
he thought this was Peter Seebach. And when even he realised he'd
attacked an innocent person, he blamed the moderator of the group
(Seebach) for not stopping him (of course, if he had, Spinoza would
have been screaming about censorship) and reverted to attacking
Seebach.

Well, the first thing I did was correct the record. Which is more than
I can say for the thugs here.
Citing him in support of whatever your issues are with "CLC regs" is
not going to gain you any credibility.

We don't want your credibility. You people lie to each other and to
newbies.
 
S

spinoza1111

It doesn't matter how many times this is said - there remain people
who will never understand or believe it.



It is also my experience that some people can /teach/ a subject, and
quite badly, without ever having taken the trouble to learn that
subject. (I had such a teacher on my C course. For example, I had not
only to explain but actually to demonstrate to her that the
controlling condition on a loop is tested only once per iteration,
not after every single statement.)

I find it hard to believe that she believed any such thing. Based on
my own experience with disruptive students with learning and
behavioral disorders, as well as your behavior here, I think you wrote
down something she said in class and thereafter interpreted it
literally, because you do so here and you are a Christian
Fundamentalist, where such folks set great store by literal
hermeneutics.

I think you then bullied her during the rest of the class,
monopolizing the class and creating confusion. I think you resented
her position and her gender. I think you unconsciously followed the
example of Nazi students.

For this and other reasons, taking
a class is no guarantee of learning a subject properly. Nor is it a
guarantee of not learning the subject properly, however.

Nor is memorizing a standard, dear boy. Indeed, in the absence of even
flawed certification procedures, it becomes a matter of what loud fat
men say.
 
S

spinoza1111

<snip>




The newsgroup comp.lang.c does not have a moderator.


Surely you're aware that people can learn a subject, and quite well, without
having taken a class, right?

Actually, I think that's only rarely true, although it is a favorite
myth of the sort of people you see actually attending wikipedia
conventions: fat, doughy, dull-eyed people who as cult members believe
that they can bypass traditional academia.

I think that autodidacts here consistently confuse the bad decisions
of C with computer science and in fact confuse a pre-science (a
grammatical taxonomy that is flawed) with actual science.

I also think that most of the autodidacts here have serious learning
and behavioral problems which have caused them to fail at university
studies, but to get hired by corporations that have long learned how
to use negative dynamics: to mobilize fear and low-level hatred to
make people "produce".
 
K

Kenny McCormack

(Some schmuck wrote)
I find it hard to believe that she believed any such thing. Based on
my own experience with disruptive students with learning and
behavioral disorders, as well as your behavior here, I think you wrote
down something she said in class and thereafter interpreted it
literally, because you do so here and you are a Christian
Fundamentalist, where such folks set great store by literal
hermeneutics.

You certainly got that right. Given that the whole game in CLC (and,
unfortunately, in Usenet as a whole, but nowhere else [IME] as severe
and unforgiving as in CLC) is to stare at something, that someone else
wrote, until you can come up with an absurd interpretation. Then you
post a reply that assumes that that interpretation is the only possible
one.
 
S

spinoza1111

...
(Some schmuck wrote)
I find it hard to believe that she believed any such thing. Based on
my own experience with disruptive students with learning and
behavioral disorders, as well as your behavior here, I think you wrote
down something she said in class and thereafter interpreted it
literally, because you do so here and you are a Christian
Fundamentalist, where such folks set great store by literal
hermeneutics.

You certainly got that right.  Given that the whole game in CLC (and,
unfortunately, in Usenet as a whole, but nowhere else [IME] as severe
and unforgiving as in CLC) is to stare at something, that someone else
wrote, until you can come up with an absurd interpretation.  Then you
post a reply that assumes that that interpretation is the only possible
one.

We can change this, Kenny. The new game starts now. And the rules are
found in The Psychology of Computer Programming: no personal attacks,
just problem solving, active tolerance of alternate points of view,
and the absolute right of personal verbal self-defense.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top