Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!spool.mu.edu!munnari.oz.au!mel.dit.csiro.au!yarra!pta!teti!teslab!andrew From: andrew@teslab.lab.OZ (Andrew Phillips) Newsgroups: comp.sys.amiga.programmer Subject: Re: Side Effects == Rattlesnakes -- watch out for them Summary: arguments are evaluated before function is called Message-ID: <1250@teslab.lab.OZ> Date: 15 May 91 03:44:11 GMT References: <1991May4.161920.23798@NCoast.ORG> Reply-To: andrew@teslab.lab.oz.au (Andrew Phillips) Organization: Technology Evaluation Section, L.A.B., Sydney Lines: 22 >>> jsmoller@jsmami.UUCP (Jesper Steen Moller) writes: >>>> Oh, by the way: func(a++) Is "a" increased before or after the >>>> function call. I think I once read in K&R that it was undefined, but >>>> I might be mistaken. You are mistaken. You are probably confusing this with the fact that the it is not specified whether the function designator is evaluated before or after the arguments. (Note that the function designator may have side effects as it can be any expression that evaluates to a pointer to a function.) From K&R2 page 202: "The order of evaluation of arguments is unspecified; ... However, the arguments and the function designator are completely evaluated, including all side effects, before the function is entered." I apologise for the delay in adding to this thread (I have been away) but this fact made the whole discussion rather absurd. Andrew. -- Andrew Phillips (andrew@teslab.lab.oz.au) Phone +61 (Aust) 2 (Sydney) 289 8712