Path: utzoo!attcan!uunet!wuarchive!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.std.c Subject: Re: constant expressions Message-ID: <13555@smoke.BRL.MIL> Date: 15 Aug 90 13:09:06 GMT References: <1916@tkou02.enet.dec.com> <13550@smoke.BRL.MIL> <1923@tkou02.enet.dec.com> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 15 In article <1923@tkou02.enet.dec.com> diamond@tkou02.enet.dec.com (diamond@tkovoa) writes: >Yes, section 3.4 says that a constant expression CAN be evaluated during >translation. It is sufficiently clear that the translator is NOT REQUIRED >to do so. Wrong, at least when the translator needs to evaluate the expression in order to perform the translation. If the translator is able to "intuit" the correct code without evaluation of constant expressions, it of course is allowed to do so, since the standard specifies external characteristics of the programs that a conforming translator must accept, not internal details of how a translator is actually implemented. However, a conforming implementation must ACT exactly as though constant expressions ARE evaluated in many contexts. Since I don't believe in magic, I don't know how it could obtain the required results without in fact evaluating the expressions, in some meaningful sense of the term "evaluate".