Path: utzoo!utgpu!water!watmath!clyde!att!att-ih!pacbell!ames!umd5!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!uiucdcs!uxc.cso.uiuc.edu!uxe.cso.uiuc.edu!mcdonald From: mcdonald@uxe.cso.uiuc.edu Newsgroups: comp.lang.c Subject: Re: Referencing through a null pointer Message-ID: <225800028@uxe.cso.uiuc.edu> Date: 27 Apr 88 13:50:00 GMT References: <4729@cup.portal.com> Lines: 22 Nf-ID: #R:cup.portal.com:4729:uxe.cso.uiuc.edu:225800028:000:1180 Nf-From: uxe.cso.uiuc.edu!mcdonald Apr 27 08:50:00 1988 /* Written 6:04 pm Apr 25, 1988 by henry@utzoo.uucp in uxe.cso.uiuc.edu:comp.lang.c */ > 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). Actually, no. The a.out header was not part of the actual core image, so the first instruction of the program was first; in practice this was the "setd" that got the floating-point processor into the right mode (or tipped the software off that the processor lacked hardware floating point), which gave *(char *)0 == 011 and *(short *)0 == 0170011. The programs which made assumptions about *0 were generally the big ones, which ran split-space of necessity. -- "Noalias must go. This is | Henry Spencer @ U of Toronto Zoology non-negotiable." --DMR | {ihnp4,decvax,uunet!mnetor}!utzoo!henry /* End of text from uxe.cso.uiuc.edu:comp.lang.c */ Actually, yes. I think Henry is making a unstated assumption: his use of the phrase "a.out" implies he is thinking of Unix. Most PDP-11's run RT-11. The memory location 0 in RT-11 is indeed 7. Thus if you're not using relocation, *(char *)0 is 7. I just tried it. Doug McDonald