Another sizeof question

Rahul Dhesi dhesi%cirrusl at oliveb.ATC.olivetti.com
Wed Oct 31 14:01:59 AEST 1990


In <13171 at crdgw1.crd.ge.com> volpe at camelback.crd.ge.com (Christopher R
Volpe) writes:

>Can someone tell me whether "sizeof" expressions are allowed as 
>operands of "#if"?

There do exist compilers that allow sizeof in expressions that are
operands of #if.  A careful reading of K&R between the lines suggests
that sizeof in #if should be legal, but they don't outright say so.

ANSI C disallows sizeof in #if so that the preprocessor may be
implemented independently of the compiler.

I was a little surprised to discover that ANSI C tries to allow the
preprocessor to be separately implementable, but it does not require it
to be separately available.
--
Rahul Dhesi <dhesi%cirrusl at oliveb.ATC.olivetti.com>
UUCP:  oliveb!cirrusl!dhesi
A pointer is not an address.  It is a way of finding an address. -- me



More information about the Comp.std.c mailing list