Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!husc6!seismo!mimsy!chris From: chris@mimsy.UUCP Newsgroups: comp.lang.c Subject: Re: short circuit evaluation Message-ID: <5388@mimsy.UUCP> Date: Wed, 11-Feb-87 23:34:27 EST Article-I.D.: mimsy.5388 Posted: Wed Feb 11 23:34:27 1987 Date-Received: Thu, 12-Feb-87 23:29:51 EST References: <4391@brl-adm.ARPA> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 21 Summary: Bad example; try again Concerning guarantees as to evalutions, in article <4391@brl-adm.ARPA> I wrote: > a = 0 * *p++ * *q++; > >Should we also say that the memory references in the third expression >must occur? ... if so, must the compiler also do the multiply? (It might >overflow, which could be important.) Bad example; the compiler is certainly allowed (0 * *p++) giving 0 giving * *q++ giving 0, which does not overflow. Suppose instead we have double *p, r; ... r = *p++ / 1.0; Must this do the divide, possibly causing (e.g.) a reserved operand fault on a Vax due to an invalid float value at *p? -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) UUCP: seismo!mimsy!chris ARPA/CSNet: chris@mimsy.umd.edu