Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!hobbes.physics.uiowa.edu!news.iastate.edu!sharkey!amara!mcdaniel From: mcdaniel@adi.com (Tim McDaniel) Newsgroups: comp.lang.c Subject: Re: Evaluation of if's Message-ID: Date: 5 Jun 91 14:03:31 GMT References: <1991Jun4.233928.5185@athena.mit.edu> <1991Jun5.014758.10616@wdl1.wdl.loral.com> Sender: news@adi.COM Distribution: usa Organization: Applied Dynamics International, Inc.; Ann Arbor, Michigan, USA Lines: 27 In-reply-to: bard@cutter.ssd.loral.com's message of 5 Jun 91 01:47:58 GMT About "if ( (i=1) == (i=2) )": bard@cutter.ssd.loral.com (J H Woodyatt) writes: What fringy kinds of things in a standard can one expect compilers to sometimes overlook and thus be classifiable in the category of `Bad Programming Practice.' Mr. Woodyatt should be more concerned about what HE overlooked: In article <1991Jun4.233928.5185@athena.mit.edu>, scs@adam.mit.edu (Steve Summit) writes: |> The comp.lang.c frequently-asked questions list has a bit to say |> about undefined order of evaluation. Did you check it first? Frequently-Asked Questions section 3, "Order of Evaluation", questions 25 and 26. E-mail me for a copy if it has expired on your system. K&R discuss the subject in section 2.12, "Precedence and Order of Evaluation", pp. 52-54; also A7, "Expressions", paragraph 2, p. 200. (2nd edition, 1st printing.) Look for "side effects" in the index. Also see "C Traps and Pitfalls", by Andrew Koenig -- a fine book. -- "Of course he has a knife; he always has a knife. We all have knives. It's 1183 and we're barbarians." Tim McDaniel Applied Dynamics Int'l.; Ann Arbor, Michigan, USA Internet: mcdaniel@adi.com UUCP: {uunet,sharkey}!amara!mcdaniel