Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!swrinde!cs.utexas.edu!ginosko!uakari.primate.wisc.edu!xanth!kremer From: kremer@cs.odu.edu (Lloyd Kremer) Newsgroups: comp.lang.c Subject: Re: sizeof a struc field Summary: It's the dereferencing of the nil pointer that is illegal Message-ID: <10207@xanth.cs.odu.edu> Date: 17 Oct 89 16:23:48 GMT References: <7710@microsoft.UUCP> <11086@smoke.BRL.MIL> <131@dtoa3.dt.navy.mil> <1890@uwbull.uwbln.UUCP> Distribution: comp Organization: Old Dominion University, Norfolk, Va. Lines: 23 In article <1890@uwbull.uwbln.UUCP> ckl@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!