Subject: Re: main return...
To: None <greywolf@defender.VAS.viewlogic.com, jfw@FunHouse.com>
From: Peter Seebach <seebs@solon.com>
List: current-users
Date: 03/28/1996 06:40:18
>Well, hell. According to K&R's table of evaluation order, things get
>evaluated from right-to-left with assignment operators last in line; i.e.
>things happen to the variables, then the assignment ops go through.
Ahh, but that's not evaluation order. That's *parsing* order.
This summarizes the whole issue.
Compilers may reorder operations, and, because we can never have to writes
to one object, or a read of an object *and* a write to one object, between
sequence points, they can do so quite a lot, and safely.
>[Hmm, I suppose that if the exact address is not in scope it would be
>considerably difficult. Okay, I concede...]
An interpreter could do it. My C implementation (to be written as soon
as anyone contributes the $80+k I'd need to live on for the time it would
take to write it) will detect it.
>Hmmm. Perhaps the compilers should define the undefined behaviour to
>start up "/usr/games/rogue".
I assume you're aware of the historical precedent?
-s