Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!sharkey!cfctech!teemc!ka3ovk!ki4pv!cdis-1!tanner From: tanner@cdis-1.uucp (Dr. T. Andrews) Newsgroups: comp.lang.c Subject: Re: sizeof a struc field Message-ID: <7678@cdis-1.uucp> Date: 9 Oct 89 14:06:39 GMT References: <7710@microsoft.UUCP> <11086@smoke.BRL.MIL> <131@dtoa3.dt.navy.mil> <11227@smoke.BRL.MIL> Organization: Society to Save the Sand Gnat Lines: 13 In article <11227@smoke.BRL.MIL>, gwyn@smoke.BRL.MIL (Doug Gwyn) writes: )) ... WHY (((type *)0)->anything) is disallowed in the context )) of compile-time expressions. ) Because (type *)0 is SYNTACTICALLY a null pointer, and there is a ) prohibition against using a null pointer as the left operand of ->. It is begging the question to say that "it is disallowed because it is prohibited". The sizeof() operator is used to extract type information, and the cited NULL pointer happens to come complete with all of the required type information. -- Cutting half of passenger service | {bpa,uunet}!cdin-1!cdis-1!tanner Mulroney: "cold froze our brains" | {attctc gatech!uflorida}!ki4pv!cdis-1!tanner