Xref: utzoo comp.lang.c++:6802 comp.std.c:2606 Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!bloom-beacon!snorkelwacker!apple!sun-barr!rutgers!galaxy.rutgers.edu!argus!ken From: ken@argus.UUCP (Kenneth Ng) Newsgroups: comp.lang.c++,comp.std.c Subject: Re: references to dereferenced null pointers Message-ID: <1623@argus.UUCP> Date: 13 Mar 90 20:25:47 GMT References: <51083@microsoft.UUCP> <25EB8EE8.8462@paris.ics.uci.edu> <1990Mar12.175613.12082@utzoo.uucp> Organization: NJ Instit. of Tech: TEIES Project Lines: 27 In article <1990Mar12.175613.12082@utzoo.uucp>, henry@utzoo.uucp (Henry Spencer) writes: : ANSI C carries forward the rules from K&R1 and later references: a null : pointer is an integer *constant* zero converted to a pointer type. ANSI : does permit a *constant* expression which evaluates to zero, e.g. "1-1", : but that does not remove the requirement that the value be known at : compile time. [edit] : >once thought of doing an implementation where NULL != 0, but after further : >reading convinced myself the implementation would be invalid. : Not invalid, no; I think there are one or two such. Unwise, yes, because : many many programs are sloppy about this and have to be fixed to run on : such an implementation. I'm confused, is a non zero NULL pointer valid or not? I'm not asking if it will break 90% of the programs out there that use 0 instead of NULL. On a 370 here I'd love to define NULL as -1 because it will cause an immediate addressing exception if it is referenced. But, I was told that NULL is defined as always being the value zero. : MSDOS, abbrev: Maybe SomeDay | Henry Spencer at U of Toronto Zoology : an Operating System. | uunet!attcan!utzoo!henry henry@zoo.toronto.edu -- Kenneth Ng: Post office: NJIT - CCCC, Newark New Jersey 07102 uucp !andromeda!galaxy!argus!ken *** NOT ken@bellcore.uucp *** bitnet(prefered) ken@orion.bitnet or ken@orion.njit.edu