sizeof in #if?

William E. Davidsen Jr davidsen at steinmetz.ge.com
Wed Jul 27 00:25:30 AEST 1988


In article <12674 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:

| That should be the May 13, 1988 draft.  See footnote 74 on page 84.
| While the explicit wording against sizeof is gone (yet the explicit
| prohibition of casts remains), the footnote remarks that the expression
| is evaluated in translation phase 4, where keywords do not yet exist.
| Hence the token `sizeof' is either defined (via #define) as some other
| token, or is simply an identifier token: it cannot be used to find the
| size of an object.  (Likewise, all types do not yet exist as keywords,
| hence casts are implicitly impossible, although this is less obvious.)

  I guess some wording better be put back in fn74, since everywhere I
could find in the standard (including the index) sizeof is refered to as
an *operator* rather than a keyword or statement. As such I would expect
that it would function as well in #if as do +, -, etc. Perhaps this
should be clarified again, as it was in the 2nd draft.
-- 
	bill davidsen		(wedu at ge-crd.arpa)
  {uunet | philabs | seismo}!steinmetz!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me



More information about the Comp.std.c mailing list