Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!kddlab!titcca!sragwa!wsgw!socslgw!diamond From: diamond@csl.sony.co.jp (Norman Diamond) Newsgroups: comp.std.c Subject: Re: sizeof ((rehash *) 0)->again Message-ID: <11146@riks.csl.sony.co.jp> Date: 20 Nov 89 01:31:15 GMT References: <11138@riks.csl.sony.co.jp> <11628@smoke.BRL.MIL> Reply-To: diamond@ws.sony.junet (Norman Diamond) Organization: Sony Computer Science Laboratory Inc., Tokyo, Japan Lines: 22 In article <11628@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes: >In article <11138@riks.csl.sony.co.jp> diamond@ws.sony.junet (Norman Diamond) writes: >>Section 3.3.4 says that the result has the named type, i.e. rehash *. >>Therefore the semantics of -> select a member of the pointed-to type, >>and sizeof takes its size. > >This argument was already made and I disagreed before too. >My argument is that a null pointer does not point to anything. In the part of my posting which you deleted, I pointed out where the standard deliberately does not define a cast null pointer to be a null pointer constant, unless the cast is to void *. Therefore the compiler cannot take advantage at compile time of knowing that this is a null pointer; it has to wait until execution time (or at least it has to appear that way). Execution-time null pointers do in fact have a type which is known at compile-time. -- Norman Diamond, Sony Corp. (diamond%ws.sony.junet@uunet.uu.net seems to work) Should the preceding opinions be caught or | James Bond asked his killed, the sender will disavow all knowledge | ATT rep for a source of their activities or whereabouts. | licence to "kill".