Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!apple!shebanow From: shebanow@Apple.COM (Andrew Shebanow) Newsgroups: comp.sys.mac.programmer Subject: Re: StripAddress and pointer arithmetic Message-ID: <8463@goofy.Apple.COM> Date: 30 May 90 21:25:50 GMT References: <1990May25.194025.9751@csrd.uiuc.edu> Organization: Apple Computer Inc., Cupertino, CA Lines: 22 In article <1990May25.194025.9751@csrd.uiuc.edu> bruner@sp15.csrd.uiuc.edu (John Bruner) writes: >Taken literally, this means that it is unsafe to write > > struct something *p, things[64]; > > for (p = things; p < things + 64; p++) > ... > >because one can't rely upon the comparison "p < things+64" working. I wrote that Tech Note, and I agree that it could be clearer (sigh). The type of loop you show above will work fine without calling StripAddress. The only time you have to worry is if you are comparing two arbitrary (and possibly unrelated) addresses (for instance, if you compare a pointer parameter to a pointer stored in a list when doing a sort by address). Sorry for the confusion, Andrew Shebanow DTS Emeritus Apple Computer, Inc.