Subject: Re: NetBSD/pdp10 ?
To: None <tech-kern@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 03/07/2002 11:18:57
On Wed, Mar 06, 2002 at 06:56:32PM -0500, der Mouse wrote:
> > I was rather fond of the processor series -- byte pointers were NEAT,
> > and if you really want to purge C, the fact that not all pointers are
> > the same length on a PDP-6 or PDP-10 is a big frightening change for
> > C programmers.
>
> Well, sloppy C programmers. There are a few of us who know better.
But we still do it!
> I've often considered building a gcc variant that deliberately breaks a
> bunch of the sloppy assumptions people make - like that all pointers
> are the same size, or that *(foo **)&bar_ptr == (foo *)bar_ptr....
I THOUGHT C required that all data pointers be the same size,
but that code pointers could be entirely different beasts?
Mind you some of the M$ code models might have broken this.
(didn't ever use them, only done unix)
The fun starts if the 'null' pointer isn't the all-zero bit
pattern. Obviously you can't use bzero to clear a structure,
I'm not sure what has to happen to pointers in the bss!
However the following are portable!
fu *bar = 0;
if (bar) ...
but:
int x = 0;
bar = (fu *)x;
is not!
OTOH this breaks so much code, I don't know if anyone has
seriously implemented it.
David