Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!think!snorkelwacker!spdcc!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: DEFINITE bug in Turbo C 2.0 (WHO'S GOT THE BUG????) Message-ID: <16269@haddock.ima.isc.com> Date: 23 Mar 90 21:35:00 GMT References: <802@zeusa.UUCP> <946@lectroid.sw.stratus.com> <16259@haddock.ima.isc.com> <1990Mar23.073923.6425@cs.eur.nl> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 13 In article <1990Mar23.073923.6425@cs.eur.nl> reino@cs.eur.nl (Reino de Boer) writes: >Now, this all depends on the relative precedence of "++" and "*", and >that is all it should depend on. Please correct me if I'm wrong You're wrong. For example, another valid computation of "x = ++a * ++a" is "r1 = a+1; r2 = a+1; x = r1*r2; ++a; ++a;". The only constraint on the timing of side effects is that they must take place after the previous sequence point and before the next one. The bottom line is: that code does not produce a well-defined result. Don't write code like that. Karl W. Z. Heuer (karl@ima.ima.isc.com or harvard!ima!karl), The Walking Lint