sizeof a struc field

Norman Diamond diamond at csl.sony.co.jp
Fri Oct 13 12:09:40 AEST 1989


>-)) ... WHY (((type *)0)->anything) is disallowed in the context
>-)) of compile-time expressions.

In article <11263 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:

>-) Because (type *)0 is SYNTACTICALLY a null pointer ...
>... there IS no type information, because the construct is
>officially meaningless.  You THINK you know what type was MEANT,
>but the compiler is not obliged to mimic your thought processes.
>This is not an issue about sizeof, but rather about ->.

No type information?

int *ip;
ip = (float *) 0;

Is this legal?  A null pointer can be assigned to ip.  Null pointers
have no type?

-- 
Norman Diamond, Sony Corp. (diamond%ws.sony.junet at uunet.uu.net seems to work)
  The above opinions are inherited by your machine's init process (pid 1),
  after being disowned and orphaned.  However, if you see this at Waterloo or
  Anterior, then their administrators must have approved of these opinions.



More information about the Comp.lang.c mailing list