C machine

Usenet Administration meissner at xyzzy.UUCP
Thu Feb 4 01:14:22 AEST 1988


In article <8817 at ism780c.UUCP> marv at ism780.UUCP (Marvin Rubenstein) writes:
| The problem I (Marv Rubinstein) was trying to address is that soon (hopfully
| before we discard C) there will be machines with 48 bit (or longer) pointers
| and 32 bit arithmetic registers.  On such a machine character arrays with
| more than 2**31 elements will be reasonable.  In order to be conformining
| 'longs' would have to be defined to contain more than 32  bits to hold
| (reasonable) pointer differences, while other operations on longs would need
| only 32 bits.  That is why I think a more general solution would be to have
| the type ptrdiff_t built into the language.  Note I am not suggesting a
| change in the language, I am only suggesting that the the proposed solution
| is only marginally better than K&R's pointer difference is an int.

Shades of the 80286.  Since the difference of two pointers is only meaningful
(in C) between two elements of the same array, how can you access array
elements if an implementation allows a bigger array dimension than it can
represent with an integral type?  All sorts of things would break.
-- 
Michael Meissner, Data General.		Uucp: ...!mcnc!rti!xyzzy!meissner
					Arpa/Csnet:  meissner at dg-rtp.DG.COM



More information about the Comp.lang.c mailing list