Xref: utzoo comp.std.c++:140 comp.std.c:3477 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!lupine!rfg From: rfg@NCD.COM (Ron Guilmette) Newsgroups: comp.std.c++,comp.std.c Subject: Re: constant expressions Message-ID: <1192@lupine.NCD.COM> Date: 15 Aug 90 06:38:29 GMT References: <5930@darkstar.ucsc.edu> <1916@tkou02.enet.dec.com> Followup-To: comp.std.c++ Organization: Network Computing Devices, Inc., Mt. View, CA Lines: 18 In article <1916@tkou02.enet.dec.com> diamond@tkou02.enet.dec.com (diamond@tkovoa) writes: >In article <5930@darkstar.ucsc.edu> daniel@terra.ucsc.edu () writes: > >>Should a translator identify 1-1 as ``a constant expression evaluating >>to zero,'' (even absent optimization)? > >I have added comp.std.c to the distribution for this article, because >the C standard is almost vague on this as well. If C++ maintains >compatibility with C here, then my best guess is: > A translator does not have to compute the constant expression... Neither the C standard nor E&S are vague about this at all. Clearly, 1-1 is "a constant expression evaluating to zero". -- // Ron Guilmette - C++ Entomologist // Internet: rfg@ncd.com uucp: ...uunet!lupine!rfg // Motto: If it sticks, force it. If it breaks, it needed replacing anyway.