Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!elsie!ado From: ado@elsie.UUCP (Arthur David Olson) Newsgroups: comp.lang.c Subject: question on implementation of pointer comparisons in C Message-ID: <7387@elsie.UUCP> Date: Sun, 19-Apr-87 17:15:46 EST Article-I.D.: elsie.7387 Posted: Sun Apr 19 17:15:46 1987 Date-Received: Sun, 19-Apr-87 22:42:37 EST Followup-To: poster Organization: NIH-LEC, Bethesda, MD Lines: 23 On the 11/40's I first used C on, the code compar(p, q) char * p; char * q; { return p > q; } needs to be done using unsigned arithmetic to ensure proper results. So I was a tad surprised (when tracking down an ansitape bug) to see that on our MORE/bsd 4.3 VAX 11/750, the above code is handled using signed arithmetic. Reflecting on the way things are organized under MORE/bsd 4.3, I realized that either signed or unsigned arithmetic works--addresses in processes always have their high-order bit turned off, kernel addresses always have their high-order bit turned on, and the twain never meet. But I'm left wondering: is there any reason for signed arithmetic in handling pointer comparisons on the VAX, or is this just genetic drift? If you know, I'd appreciate hearing from you by mail. -- More is a trademark of R. J. Reynolds; VAX of Digital Equipment. -- "We must choose: the stars or the starving. Which shall it be?" UUCP: ..seismo!elsie!ado ARPA: elsie!ado@seismo.CSS.GOV Elsie and Ado are trademarks of Borden, Inc. and Ampex.