Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!sri-unix!sri-spam!mordor!lll-tis!ptsfa!hoptoad!unisoft!mtxinu!ed From: ed@mtxinu.UUCP (Ed Gould) Newsgroups: comp.lang.c,comp.unix.wizards Subject: Re: pointer alignment when int != char * Message-ID: <483@mtxinu.UUCP> Date: Thu, 27-Aug-87 19:04:23 EDT Article-I.D.: mtxinu.483 Posted: Thu Aug 27 19:04:23 1987 Date-Received: Sat, 29-Aug-87 13:24:43 EDT References: <493@its63b.ed.ac.uk> <6061@brl-smoke.ARPA> Reply-To: ed@mtxinu.UUCP (Ed Gould) Organization: mt Xinu, Berkeley Lines: 19 Xref: mnetor comp.lang.c:3975 comp.unix.wizards:3933 ># To subtract two independent large-model pointers of the type ># segment:offset, I tried this: ># ># (unsigned long) p2 - (unsigned long) p1 ># > >This is bad practice. It's also not legal in the proposed ANSI C standard. Pointers may be subtracted *only* if they point to members of the same array of elements. Casting them has no real effect on a byte- addressed machine; it's not at all obvious what it should do on other machines. -- Ed Gould mt Xinu, 2560 Ninth St., Berkeley, CA 94710 USA {ucbvax,decvax}!mtxinu!ed +1 415 644 0146 "A man of quality is not threatened by a woman of equality."