From: utzoo!decvax!decwrl!sun!megatest!fortune!hpda!hplabs!sri-unix!chris.umcp-cs@UDel-Relay Newsgroups: net.unix-wizards Title: Re: Questions about nil-pointer dereferences (the "plague") Article-I.D.: sri-arpa.754 Posted: Fri Mar 4 18:07:06 1983 Received: Fri Apr 1 05:57:04 1983 From: Chris Torek Actually, in Vax virtual memory you always have something at 0; you have the stuff that is in /lib/crt0.o (or /lib/mcrt0.o if you compiled with -p) but it isn't necessarily zero. However, you should never trust to *(int *)0 being legal -- it's not on a large number of machines (e.g. Codatas). This seems to be a common "berkeleyism" (assuming that *(int *)0 is legal). If you have a pointer which could be nil, then you should always check it first, before following it. if (p == (int *) 0 || *p == 0) { some code... } or something like that.