Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!compass!worley From: worley@compass.com (Dale Worley) Newsgroups: comp.lang.c Subject: Re: Evaluation of if's Message-ID: Date: 5 Jun 91 14:26:46 GMT References: <1991Jun4.233928.5185@athena.mit.edu> <1991Jun5.014758.10616@wdl1.wdl.loral.com> Sender: root@compass.com Distribution: usa Organization: Compass, Inc., Wakefield, MA, U.S.A. Lines: 21 In-reply-to: bard@cutter.ssd.loral.com's message of 5 Jun 91 01:47:58 GMT In article <1991Jun5.014758.10616@wdl1.wdl.loral.com> bard@cutter.ssd.loral.com (J H Woodyatt) writes: |> > if ( (i=1) == (i=2) ) |> >Is somebody wrong or is the behavior undefined? |> Of course it's undefined. (It contains two side effects not |> separated by a sequence point.) Is this really undefined by ANSI? I suppose we need someone with the STANDARD to resolve this. ANSI C Standard, Dec. 88 draft, sec. 3.3, p. 39, l. 5: Between the previous and next sequence point an object shall have its stored value modified at most once by the evaluation of an expression. Why don't people out there just go *buy* a copy of the standard? It would resolve a lot of these questions! Dale Worley Compass, Inc. worley@compass.com -- When asked how much money is enough, Nelson Rockefeller replied: "A little bit more."