Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ucla-cs!maui.cs.ucla.edu!jon From: jon@maui.cs.ucla.edu (Jonathan Gingerich) Newsgroups: comp.lang.c Subject: Re: Short circuit evaluation/expression rearrangement (2nd summary) Message-ID: <1991Jun6.171240.23388@cs.ucla.edu> Date: 6 Jun 91 17:12:40 GMT References: <1991Jun3.222214.20948@zoo.toronto.edu> <1991Jun5.231833.20542@sq.sq.com> Sender: usenet@cs.ucla.edu (Mr. News Himself) Organization: UCLA Computer Science Department Lines: 18 Nntp-Posting-Host: maui.cs.ucla.edu In article <1991Jun5.231833.20542@sq.sq.com> msb@sq.sq.com (Mark Brader) writes: >Wow, I get to correct Henry Spencer. >> > [a + b + c] >> > What you DO know: The addition of a and b will be made before c is >> > added to the result. >> >> More precisely, what you know is that the program will *behave as if* things >> were done that way. In particular, if the compiler can be sure that the >> order of evaluation will not affect behavior, it can use any order it pleases. > >Still more precisely, what you know is that *if* the program would *not* >cause an exception (e.g. overflow) if things were done that way, *then* >it will behave *as if* things were done that way. No, Henry is correct. How can you distinguish the evaluation of a rearranged expression from an undefined evaluation which could be _anything_? Jon.