Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!purdue!haven!adm!xadmx!rbj@dsys.ncsl.nist.gov From: rbj@dsys.ncsl.nist.gov (Root Boy Jim) Newsgroups: comp.unix.wizards Subject: Referencing NULL pointers Message-ID: <20245@adm.BRL.MIL> Date: 13 Jul 89 20:56:27 GMT Sender: news@adm.BRL.MIL Lines: 32 ? From: Guy Harris ? 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. Which, under the right circumstances, might be what you want. Consider the following structure on a 680x0: struct vec { long boot_sp; long boot_pc; long bus_trap; ... } *p0 = 0; p0->bus_trap = (long) ; When probing for memory at boot time, the kernel temporarily substitutes its own trapping routine. Admittedly, this is an uncommon use of this technique, and it probably doesn't use a structure anyway, but it could. ? "valid" doesn't mean "anything you can get away with without a core ? dump". This statement is absolutely correct. The case I mentioned is the only legal use of the zero pointer. And its definitely non-portable, as no two machines seem to have the same page zero format. Root Boy Jim Have GNU, Will Travel.