Path: utzoo!utgpu!watserv1!watmath!att!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: the nil pointer is not zero Message-ID: <14516@smoke.brl.mil> Date: 17 Nov 90 21:01:39 GMT References: <27636@mimsy.umd.edu> <164@nazgul.UUCP> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 20 In article <164@nazgul.UUCP> bright@nazgul.UUCP (Walter Bright) writes: -Or a third method, commonly used on the PC: 0 is both the NULL pointer -*and* is a valid address. If you wish to poke into the interrupt vector -table, nothing stops you from doing this (and it works fine): - long far *p = 0; - *p = whatever; -I'm also told that this solution is used on that Prime computer which seems -to be the only one where NULL!=0. All that is necessary is to adjust malloc -and the layout of the code and data so that it never sits on 0. Certainly nothing stops you from dereferencing a null pointer (which is what your example does), on systems where it happens to work by accident. -I think the ANSI C committee missed the boat on this. Thousands of hours -of wasted time, confusion, and net debate would have been eliminated if -NULL had been fixed at all bits 0. I don't think so. What good would it do you to know how a null pointer is represented? There is nothing useful you can do about that.