Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!sun-barr!newstop!sun!amdcad!dgcad!dg-rtp!sheol!throopw From: throopw@sheol.UUCP (Wayne Throop) Newsgroups: comp.lang.c Subject: Re: NULL question not in FAQ Summary: "that turns out not to be the case" Message-ID: <1636@sheol.UUCP> Date: 8 Apr 91 00:25:46 GMT References: <1991Mar26.235643.4498@ux1.cso.uiuc.edu> <1991Mar27.194101.1685@grebyn.com> <1103@gtenmc.UUCP> Lines: 20 > ravim@gtenmc.UUCP (Vox Populi) > The same result (getting a pointer value to be all null bytes) can also be > achieved by declaring the pointer variable to be either static or/and global, > since static/global variables are automatically initialized to zeroes. As the cliche now goes.... "Bzzzzzzzzt! Wrong! But thank you for playing our game!" The problem here is that pointers and floating point values are a special case, and initializing them to zero doesn't guarantee a byte-wise or bit-wise zero value. Further, uninitialized static or global variables of these types are mandated by X3J11 (the ANSI C standard) to act like they'd been subjected to initializers to zero, not to "bzero" or "all bits (or bytes) zeroed". Um... that is... unless the phrase "can be achieved" meant "on some particular machines", rather than "portably". -- Wayne Throop ...!mcnc!dg-rtp!sheol!throopw