Re: ANSI C clarifications, with citations
lars brinkhoff (lars.brinkhoff@intermec.com)
Thu, 29 Jun 2000 11:34:28 +0200
Michael Meissner wrote:
> On Wed, Jun 28, 2000 at 03:28:17AM -0400, Albert D. Cahalan wrote:
> > > Sandy said:
> > >> Cast a char * to int * on any architecture with strong alignmenmt
> > >> restrictions and watch your code commit messy suicide.
> >
> > Oh no, the cast works perfectly well. The derereference is another
> > matter of course, and you'd better make sure you satisfy alignment
> > needs. Cast to long and mask off bits or cast to smaller types.
>
> Wrong. There have been machines in the past with just those
> restrictions.
>
> The one I'm most familar with is the Data General MV/Eclipse machine
> that I wrote a C compiler for. The original 16-bit machine of the
> series had no byte pointers, and the word pointer format had an
> indirection bit as the top bit. When they finally added byte pointers,
> the byte pointer was the word pointer shifted left one bit position
> (losing the indirection bit), and the bottom bit was then a byte
> selector.
>
> Other machines included PR1ME computers which used a 32-bit word
> pointer, and a 48-bit byte pointer.
How did C on those machines implement a void *?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/