Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!ames!lll-winken!uunet!mcrware!jejones From: jejones@mcrware.UUCP (James Jones) Newsgroups: comp.lang.c Subject: Re: Another silly question Summary: is + really associative when pointers are involved? Keywords: pointers, canonical counterexample Message-ID: <1176@mcrware.UUCP> Date: 18 May 89 14:52:21 GMT References: <17812@cup.portal.com> <2336@Portia.Stanford.EDU> <25671@amdcad.AMD.COM> Reply-To: jejones@mcrware.UUCP (James Jones) Distribution: usa Organization: Microware Systems Corp., Des Moines, Iowa Lines: 17 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