Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Re: machine specific languages (was: Re: C machine) Message-ID: <7167@brl-smoke.ARPA> Date: 22 Jan 88 21:12:45 GMT References: <9907@mimsy.UUCP> <5360001@hpisla.HP.COM> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 13 In article <5360001@hpisla.HP.COM> wolpert@hpisla.HP.COM (David Wolpert) writes: >... but the 32-bit case is the same: the difference between two unsigned >32-bit pointers can exceed the range of a 32-bit 2's complement number. >Maybe ptrdiff_t wasn't intended to handle the case of more than half of >the machine's address space allocated to one object? Yes, on a 32-bit "long" machine, ptrdiff_t cannot represent the difference of pointers TO CHARS in an array having more than 2^31 chars. Pointers to things larger than chars have no such problem. We couldn't think of any clean way to fix this part of the pointer-diff problem, and decided it wasn't very important in practice. Who would actually have an application that needs to do this?