🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2722

Re: More Re: Function Argument Evaluation argument

#2722
From: Jonathan Gingerich
Date: Wed, 10 Apr 1991 19:18
29 lines
1978 bytes
In article <3731@inews.intel.com> bhoughto@nevin.intel.com (Blair P. Houghton) writes:
>In article <1991Apr8.191009.24897@cs.ucla.edu> jon@maui.cs.ucla.edu (Jonathan Gingerich) writes:
>>Earlier I claimed:
>>
>>	printf("%d %d\n", f(...v...), f(...v++...))
>[was unspecified not undefined]
>> In my previous example however, I believe that v
>>and v++ could be evaluated before either s.p. thus it is undefined.
>
>Again, it's confused.  There are two sequence points
>among the arguments to printf(); they are the calls
>to the function f().  Sequence points are defined
>in terms of their proscriptions on side effects.
>Since `v++' has a side effect (the assignment of
>v+1 to v), it must be evaluated after the preceding
>sequence point and prior to the sequence point
>defined by the rightward call to f().  It is unspecified
>whether the preceding sequence point comes from some
>earlier statement or from the leftward call to f().
>However, the first usage of `v' has no side effects.
>It can be evaluated regardless of sequence points
>other than the one for the leftward call to f().
>The value for `v' in the leftward call is indeterminate.

You are correct as far as you go.  But v and v++ can both be evaluated before
either s.p. associated with the application of f()'s and because v is both
read and written in separate actions it's undefined.

Jon.
Technical Details
Message-ID: <1991Apr10.191853.4604@cs.ucla.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!ucla-cs!maui.cs.ucla.edu!jon
References: <1991Apr6.022220.6449@twinsun.com> <1991Apr8.191009.24897@cs.ucla.edu> <3731@inews.intel.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!ucla-cs!maui.cs.ucla.edu!jon
From: jon@maui.cs.ucla.edu (Jonathan Gingerich)
Newsgroups: comp.std.c
Subject: Re: More Re: Function Argument Evaluation argument
Message-ID: <1991Apr10.191853.4604@cs.ucla.edu>
Date: 10 Apr 91 19:18:53 GMT
References: <1991Apr6.022220.6449@twinsun.com> <1991Apr8.191009.24897@cs.ucla.edu> <3731@inews.intel.com>
Sender: usenet@cs.ucla.edu (Mr. News Himself)
Organization: UCLA Computer Science Department
Lines: 29
Nntp-Posting-Host: maui.cs.ucla.edu