[comp.lang.c] question on implementation of pointer comparisons in C

ado@elsie.UUCP (Arthur David Olson) (04/20/87)

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.