Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!decwrl!bacchus.pa.dec.com!shlump.nac.dec.com!tkou02.enet.dec.com!diamond From: diamond@tkou02.enet.dec.com (diamond@tkovoa) Newsgroups: comp.std.c Subject: Re: constant expressions Message-ID: <1927@tkou02.enet.dec.com> Date: 17 Aug 90 01:37:43 GMT References: <1916@tkou02.enet.dec.com> <13550@smoke.BRL.MIL> <1923@tkou02.enet.dec.com> <13555@smoke.BRL.MIL> <1924@tkou02.enet.dec.com> <1990Aug16.152345.29177@zoo.toronto.edu> Reply-To: diamond@tkou02.enet.dec.com (diamond@tkovoa) Organization: Digital Equipment Corporation Japan , Tokyo Lines: 24 In article <1990Aug16.152345.29177@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes: >In article <1924@tkou02.enet.dec.com> diamond@tkou02.enet.dec.com (diamond@tkovoa) writes: >>Besides clearly NOT REQUIRING translation-time evaluations, I have also seen >>clear REASONS for this non-requirement. If your target machine can handle >>128-bit ints, your host machine is not required to provide a simulator. >Given that the compiler is required to do type checking (must produce a >diagnostic for a violation of the rules), it's going to have to evaluate >constant expressions as subscripts in array declarations. Section 3.5.4.2 has a SEMANTICS rule about compatible array types. I cannot find a similar CONSTRAINTS rule. Therefore it seems that the compiler is permitted but not required to do this type checking, and is not required to produce a diagnostic for a violation. >Provided it can get exactly the same effect, which is going to be tricky. >The *preprocessor* is not required to emulate target arithmetic, but the >rest of the compiler is nailed down pretty strictly. The rest of the compiler is nailed down IF IT CHOOSES to compute constant expressions. It can always choose to leave a computation for execution time. -- Norman Diamond, Nihon DEC diamond@tkou02.enet.dec.com This is me speaking. If you want to hear the company speak, you need DECtalk.