🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1593

Re: constant expressions

#1593
From: Doug Gwyn
Date: Wed, 15 Aug 1990 13:09
15 lines
1427 bytes
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".
Technical Details
Message-ID: <13555@smoke.BRL.MIL>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!wuarchive!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn
References: <1916@tkou02.enet.dec.com> <13550@smoke.BRL.MIL> <1923@tkou02.enet.dec.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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