Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.wizards Subject: Re: Referencing NULL pointers Message-ID: <2219@auspex.auspex.com> Date: 11 Jul 89 19:10:05 GMT References: <19367@paris.ics.uci.edu> <1891@auspex.auspex.com> <32UP02Eg3d=801@amdahl.uts.amdahl.com> Reply-To: guy@auspex.auspex.com (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 13 >I would say that the code is valid. And you'd be wrong in saying so. The ANSI C standard makes it quite clear that dereferencing null pointers is a no-no, and K&R never said it was valid. For reasons cited in my posting, even if it *doesn't* cause a segmentation violation, the behavior isn't guaranteed; on such systems, you'd be most likely to get whatever stuff was lying around location 0 in your address space, and that can be almost anything. "valid" doesn't mean "anything you can get away with without a core dump".