Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!mandrill!hal!ncoast!allbery From: allbery@ncoast.UUCP Newsgroups: comp.lang.c,comp.unix.wizards Subject: Re: pointer alignment when int != char * Message-ID: <4286@ncoast.UUCP> Date: Sun, 30-Aug-87 10:57:46 EDT Article-I.D.: ncoast.4286 Posted: Sun Aug 30 10:57:46 1987 Date-Received: Tue, 1-Sep-87 00:45:23 EDT References: <493@its63b.ed.ac.uk> <6061@brl-smoke.ARPA> Reply-To: allbery@ncoast.UUCP (Brandon Allbery) Followup-To: comp.lang.c Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 22 Xref: utgpu comp.lang.c:3894 comp.unix.wizards:3711 As quoted from <2130@umn-cs.UUCP> by randy@umn-cs.UUCP (Randy Orrison): +--------------- | In article <483@mtxinu.UUCP> ed@mtxinu.UUCP (Ed Gould) writes: | >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. | | How is this determined? example: [deleted. ++bsa] | How does anything know if s & c are pointing to members of the same array? | If s isn't 0 terminated, c could end up anywhere... +--------------- I think that they mean that the result is only defined if the pointers are pointing to members of the same structure; in any other situation, you may get a number result but it may not have any meaning. -- Brandon S. Allbery, moderator of comp.sources.misc {{harvard,mit-eddie}!necntc,well!hoptoad,sun!mandrill!hal}!ncoast!allbery ARPA: necntc!ncoast!allbery@harvard.harvard.edu Fido: 157/502 MCI: BALLBERY <> ** Site "cwruecmp" has changed its name to "mandrill". Please re-address ** *** all mail to ncoast to pass through "mandrill" instead of "cwruecmp". ***