constant expressions

Doug Gwyn gwyn at smoke.BRL.MIL
Wed Aug 15 02:44:26 AEST 1990


In article <1916 at tkou02.enet.dec.com> diamond at tkou02.enet.dec.com (diamond at tkovoa) writes:
>In article <5930 at darkstar.ucsc.edu> daniel at 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).



More information about the Comp.std.c mailing list