Another silly question

James Jones jejones at mcrware.UUCP
Fri May 19 00:52:21 AEST 1989


A message asserts that surely

	(p + 3) + 5 == p + (3 + 5)

where p is a pointer, and so it is, but...in general, it might not be. 
We turn once again to the canonical counterexample, segmented
architectures, where it's not clear that

	(p - 5) + 6 == p + (-5 + 6)

since p - 5 might fall off the end of the segment, and after that, all
bets are likely to be off.

That said, I hasten to add that I agree that p + i == i + p; any bogosity
arising will arise no matter what order is used.

	James Jones



More information about the Comp.lang.c mailing list