Referencing through a null pointer
Chris Torek
chris at mimsy.UUCP
Sun Apr 24 21:09:50 AEST 1988
In article <4729 at cup.portal.com>, Paul_L_Schauble at cup.portal.com writes:
>Could someone please tell me which machine it was that started the
>unfortunate convention that referencing through the null pointer returns a
>zero with no error? I was under the impression it was BSD Unix, but I'm not
>sure.
PDP-11s with split I&D had a shim at data address zero; I believe the
shim was a zero. (The shim is necessary to keep the first data object
from having an address that compares equal to NULL.)
I imagine that PDP-11s without split I&D had *(char *)0 == 7 or 8, and
*(short *)0 == 0407 or 0408 (OMAGIC and NMAGIC respectively).
32V Unix had *(int *)0==0.
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain: chris at mimsy.umd.edu Path: uunet!mimsy!chris
More information about the Comp.lang.c
mailing list