sizeof a struc field

Lloyd Kremer kremer at cs.odu.edu
Wed Oct 18 02:23:48 AEST 1989


In article <1890 at uwbull.uwbln.UUCP> ckl at uwbln.UUCP (Christoph Kuenkel) writes:

>for me, ((thing *)0) sounds quite reasonable.  i agree that there is no
>meaningfull evaluation.  i never saw a compiler that claimed this
>construct to be ``syntactically wrong''.  i think that it should be
>possible to ``assign'' meaning to that construct in an unambigous way.


There is nothing wrong with ((thing *)0).  It is a nil pointer to thing.

The point is that you can't use it for anything other than to represent
an invalid or currently unassigned pointer of that type.  Specifically,
you can't "bounce off" it using the -> operator and expect the compiler to
know what you're talking about.

P.S.  I will concede that many compilers handle the construct the way you
expect, but it is not legal ANSI C and is not portable.

-- 
					Lloyd Kremer
					...!uunet!xanth!kremer
					Have terminal...will hack!



More information about the Comp.lang.c mailing list