🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2643

Re: Function Argument Evaluation

#2643
From: Norman Diamond
Date: Fri, 29 Mar 1991 07:18
26 lines
2211 bytes
In article <17985@crdgw1.crd.ge.com> volpe@camelback.crd.ge.com (Christopher R Volpe) writes:
>In article <9439@cognos.UUCP>, jimp@cognos.UUCP (Jim Patterson) writes:
>|>So, *(p=&x) is actually *(p) after assignment, not *(&x), and any of the
>|>four results quoted previously is possible.
>
>I believe that in any situation in which the behavior is *not* undefined,
>there is absolutely no difference between "the value of the left operand
>after assignment" and "the value of the right operand suitably cast to
>the type of the left operand".

If the left operand is volatile, the standard says that the value of the
right operand gets stored into it.  However, it is not quite clear if the
left operand is actually required to contain that value (for any finite
or infinitesimal length of time).  Suppose it's a hardware device which
automatically doubles the value stored into it?  (Pick a less trivial
example for this if you wish.)

The question has already been asked, if the left operand is volatile,
is the processor required to follow the store with a fetch, in order to
use the actually-contained value in the outer expression.  The answers
given in this newsgroup converged on "No," it was not necessary.  But I
sure don't understand why.  If the fetch isn't done, it sure seems to me
that it violates the rules about volatile.
--
Norman Diamond       diamond@tkov50.enet.dec.com
If this were the company's opinion, I wouldn't be allowed to post it.
Technical Details
Message-ID: <1991Mar29.071812.870@tkou02.enet.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!jrdzzz.jrd.dec.com!tkou02.enet.dec.com!jit345!diamond
References: <7621@polstra.UUCP> <17750@crdgw1.crd.ge.com> <1991Mar25.195234.7179@sq.sq.com> <9439@cognos.UUCP> <17985@crdgw1.crd.ge.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!jrdzzz.jrd.dec.com!tkou02.enet.dec.com!jit345!diamond
From: diamond@jit345.swstokyo.dec.com (Norman Diamond)
Newsgroups: comp.std.c
Subject: Re: Function Argument Evaluation
Message-ID: <1991Mar29.071812.870@tkou02.enet.dec.com>
Date: 29 Mar 91 07:18:12 GMT
References: <7621@polstra.UUCP> <17750@crdgw1.crd.ge.com> <1991Mar25.195234.7179@sq.sq.com> <9439@cognos.UUCP> <17985@crdgw1.crd.ge.com>
Sender: usenet@tkou02.enet.dec.com (USENET News System)
Reply-To: diamond@jit345.enet@tkou02.enet.dec.com (Norman Diamond)
Organization: Digital Equipment Corporation Japan , Tokyo
Lines: 26