Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!rpi!crdgw1!crdos1!davidsen From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) Newsgroups: comp.lang.c Subject: Re: sizeof a struc field Message-ID: <864@crdos1.crd.ge.COM> Date: 6 Oct 89 15:28:50 GMT References: <7710@microsoft.UUCP> <11086@smoke.BRL.MIL> <131@dtoa3.dt.navy.mil> <7653@cdis-1.uucp> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Organization: GE Corp R&D Center Lines: 15 In article <7653@cdis-1.uucp>, tanner@cdis-1.uucp (Dr. T. Andrews) writes: | Remember that sizeof() is a compile-time operation. Do we expect | the compiler to do flow analysis to determine whether we are feeding | a valid pointer into a sizeof() expression? Why should flow analysis be needed? If the pointer is defined, call it p, then: sizeof(p) sizeof a pointer to a {type} sizeof(*p) sizeof an object of {type} -- bill davidsen (davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen) "The world is filled with fools. They blindly follow their so-called 'reason' in the face of the church and common sense. Any fool can see that the world is flat!" - anon