Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!brl-adm!adm!Schauble@mit-multics.arpa From: Schauble@mit-multics.arpa Newsgroups: comp.lang.c Subject: Pointer comparison and Portability Message-ID: <4537@brl-adm.ARPA> Date: Thu, 19-Feb-87 05:22:26 EST Article-I.D.: brl-adm.4537 Posted: Thu Feb 19 05:22:26 1987 Date-Received: Fri, 20-Feb-87 01:56:05 EST Sender: news@brl-adm.ARPA Lines: 16 Unfortunately, the Intel 8086 series provides another counter example. On this machine, address are in the form of segment and offset. The Actual Address is 16*segment + offset. This is usually written as segment:offset. Thus, the two pointers 0100:0010 and 0101:0000 point at the same byte. If compared, they will *NOT* compare equal. So, if two pointers compare equal, they definately point at the same object. However, the converse is not true. Two pointers that do not compare equal do NOT (necessarily) point at different objects. Seems like when K & R says that pointer comparison is undefined except when the two are pointers to the same array, it should be taken to mean exactly that for all operators, including == and !=. Paul Schauble at MIT-Multics.arpa