Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!snorkelwacker!apple!usc!zaphod.mps.ohio-state.edu!rpi!bu.edu!husc6!spdcc!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Ambiguities Message-ID: <17983@haddock.ima.isc.com> Date: 12 Sep 90 18:18:51 GMT References: <862@gtenmc.UUCP> Reply-To: karl@kelp.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 21 In article <862@gtenmc.UUCP> csp@gtenmc.UUCP (Charudutta S. Palkar) writes: >Does C mention , which instance of the variable should be used , >while evaluating the expression. No, it's explicitly undefined. This is intentional. >If some programmers cannot use its features they might as well >stop using it. In this case, they should stop using *those features*, since they are not actual properties of the language. There's a tradeoff involved when deciding whether to guarantee such things. In the case of "&&", it's extremely useful to be able to write things like "if (p != NULL && isgood(p->thing)) ...", but most people don't care about "a[i++] = b[i++]" and wouldn't make heavy use of it even if it were well-defined. Leaving it explicitly undefined gives the compiler a license to rearrange the subexpressions for efficiency, which is generally considered a good thing. Karl W. Z. Heuer (karl@kelp.ima.isc.com or ima!kelp!karl), The Walking Lint