Xref: utzoo comp.std.c++:139 comp.std.c:3475 Path: utzoo!attcan!uunet!cs.utexas.edu!yale!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.std.c++,comp.std.c Subject: Re: constant expressions Message-ID: <13550@smoke.BRL.MIL> Date: 14 Aug 90 16:44:26 GMT References: <5930@darkstar.ucsc.edu> <1916@tkou02.enet.dec.com> Followup-To: comp.std.c++ Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 11 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. The C standard is not at all vague about this; see section 3.4. "1-1" is definitely an integral constant expression with value zero. It may be used any place that the integral constant "0" could be used, including in constructing a null pointer constant (see section 3.2.2.3).