constant expressions

Doug Gwyn gwyn at smoke.BRL.MIL
Sat Aug 18 04:40:02 AEST 1990


In article <1958 at rossignol.Princeton.EDU> drh at cs.Princeton.EDU (Dave Hanson) writes:
>So it appears that, where the standard says that the compiler CAN
>compute constants at translation time, the standard almost lies.
>The compiler MUST compute constants at translation time.
>This is unfortunate (because a cross-compiler will become difficult).
>(It's not quite a lie because the standard's words don't contradict each
>other, only the implications do.  Why say "can" when it means "must"?)

The problem is that you are applying an unjustified interpretation to
the wording of the 3.4 Description section.  That sentences simply
explains what constant expressions are all about; it cannot reasonably
be interpreted as granting any additional license to the implementation.
It does promise PROGRAMMERS that it is safe to use constant expressions.



More information about the Comp.std.c mailing list