🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2645

Re: Function Argument Evaluation

#2645
From: Jonathan Gingerich
Date: Fri, 29 Mar 1991 17:43
18 lines
1075 bytes
In article <1991Mar28.194627.26285@mtxinu.COM> ed@mtxinu.COM (Ed Gould) writes:
>Will this do?
>
>	foo() {
>		int v = 1;
>
>		printf("%d %d\n", v, ++v);
>	}

The first argument of v reads v without using the value to set v, so this
too is undefined.

I think "order of evaluation" is a non-issue in ANSI C; 3.3 seems pretty
air-tight.  Therefore the value of (l=r) is only of interest in K&R(I) were
the language is similar to (++x), so it's pretty ambiguous.  ANSI C has 
leap-frogged the whole issue.

Jon.
Technical Details
Message-ID: <1991Mar29.174345.22020@cs.ucla.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!orion.oac.uci.edu!ucivax!ucla-cs!maui.cs.ucla.edu!jon
References: <15607@smoke.brl.mil> <17983@crdgw1.crd.ge.com> <1991Mar28.194627.26285@mtxinu.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!orion.oac.uci.edu!ucivax!ucla-cs!maui.cs.ucla.edu!jon
From: jon@maui.cs.ucla.edu (Jonathan Gingerich)
Newsgroups: comp.std.c
Subject: Re: Function Argument Evaluation
Message-ID: <1991Mar29.174345.22020@cs.ucla.edu>
Date: 29 Mar 91 17:43:45 GMT
References: <15607@smoke.brl.mil> <17983@crdgw1.crd.ge.com> <1991Mar28.194627.26285@mtxinu.COM>
Sender: usenet@cs.ucla.edu (Mr. News Himself)
Organization: UCLA Computer Science Department
Lines: 18
Nntp-Posting-Host: maui.cs.ucla.edu