Path: utzoo!attcan!uunet!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.unix.wizards Subject: Re: What machines core dump on deref of NULL? Message-ID: <13318@smoke.BRL.MIL> Date: 8 Jul 90 06:07:02 GMT References: <418@minya.UUCP> <1990Jul6.152722.5320@eng.umd.edu> <9361@rice-chex.ai.mit.edu> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 22 In article <9361@rice-chex.ai.mit.edu> bson@rice-chex.ai.mit.edu (Jan Brittenson) writes: >>Distinguishable in this sense just means you can use tests like >>p=0; >>if (p == &someobject) >> code(); >>else >> othercode() >>which will always fail Correct, and that is the primary reason why the C standard requires that a null pointer not compare equal to a pointer to any object. > Not if someobject resides at address 0, in which case p does point >to an object. A conforming C implementation cannot allocate someobject at such as address that a pointer to it is indistinguishable from a null pointer. A (not strictly conforming) application may, through appropriate implementation-specific manipulations, produce such an object pointer, but what it points to will not qualify as an "object" in the sense in which the term is used in the C standard.