Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!purdue!haven!decuac!shlump.nac.dec.com!tkou02.enet.dec.com!diamond From: diamond@tkou02.enet.dec.com (diamond@tkovoa) Newsgroups: comp.lang.c Subject: Re: () ignored in some expressions Message-ID: <1458@tkou02.enet.dec.com> Date: 11 Apr 90 01:59:41 GMT References: <48079@lanl.gov> <1272@sdrc.UUCP> Reply-To: diamond@tkou02.enet.dec.com (diamond@tkovoa) Organization: Digital Equipment Corporation Japan , Tokyo Lines: 17 In article <1272@sdrc.UUCP> scjones@sdrc.UUCP (Larry Jones) writes: >ANSI C requires that all expressions be evaluated as >written. Thus for "a + b + c" the compiler must add a and b >first, then add c to the result. No. For "a + b + c", the compiler may add a + c, then add b to the result, if it wishes, or if it generates faster code. This whole discussion concerns whether () may be ignored. In ANSI, for "(a + b) + c", the () must be obeyed. Now the compiler must add a and b first, then add c, or else do something that has the same exact behavior. -- Norman Diamond, Nihon DEC diamond@tkou02.enet.dec.com This_blank_intentionally_left_underlined________________________________________