Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!hp4nl!eurtrx!euraiv1!reino From: reino@cs.eur.nl (Reino de Boer) Newsgroups: comp.lang.c Subject: Re: DEFINITE bug in Turbo C 2.0 (WHO'S GOT THE BUG????) Message-ID: <1990Mar23.073923.6425@cs.eur.nl> Date: 23 Mar 90 07:39:23 GMT References: <802@zeusa.UUCP> <946@lectroid.sw.stratus.com> <16259@haddock.ima.isc.com> Organization: Erasmus Universiteit Rotterdam, dept. CS (Informatica) Lines: 37 karl@haddock.ima.isc.com (Karl Heuer) writes: >>[Several other compilers give still different results] >>WHO'S GOT THE BUG????? >The author of the code. I think the point made was not that the results should be the same, but that the following code #define f(a) a*a int a, x; a = 10; x = f( ++a ); should either compute r1 = ++a; r2 = ++r1; x = r1 * r2; or r2 = ++a; r1 = ++r2; x = r1 * r2; in which case both computations leave (11 * 12) in "x". Now, this all depends on the relative precedence of "++" and "*", and that is all it should depend on. To my knowledge the unary operators have priority below the primary operators, but higher than any other binary operator. Please correct me if I'm wrong, Reino -- Reino R. A. de Boer "We want to build the right product right, right?" Erasmus University Rotterdam ( Informatica ) e-mail: reino@cs.eur.nl