Path: utzoo!attcan!uunet!samsung!usc!zaphod.mps.ohio-state.edu!wuarchive!texbell!ficc!peter From: peter@ficc.ferranti.com (Peter da Silva) Newsgroups: comp.lang.c Subject: Re: What C compilers have non-zero null pointers? Message-ID: Date: 17 Jul 90 14:35:10 GMT References: <9007161750.AA00664@edison.CHO.GE.COM> Reply-To: peter@ficc.ferranti.com (Peter da Silva) Organization: Xenix Support, FICC Lines: 15 In article <9007161750.AA00664@edison.CHO.GE.COM> rja writes: > I used to use a compiler for MSDOS and the 80x86 cpus > whose NULL pointer was F000:0000 hex when examined via > a debugger. It of course did compile fine as long as one > used sense and compared pointers to NULL rather than > a constant of zero... If that was the case, the compiler was broken. A constant zero in a pointer context is the definition of NULL. !pointer == 0! and !pointer == NULL! should evaluate the same way (as if they generated the same code). > Compilers where NULL isn't represented as all zero bits > just aren't that uncommon. Compilers where it's something you need to watch out for should be. -- Peter da Silva. `-_-' +1 713 274 5180.