Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!uunet!mcsun!ukc!warwick!cudcv From: cudcv@warwick.ac.uk (Rob McMahon) Newsgroups: comp.lang.c Subject: Re: pointer representation (was: Re: effect of free()) Message-ID: <206@titania.warwick.ac.uk> Date: 14 Sep 89 21:55:08 GMT References: <319@cubmol.BIO.COLUMBIA.EDU> <3756@buengc.BU.EDU> <29171@news.Think.COM> <2079@munnari.oz.au> <29250@news.Think.COM> Reply-To: cudcv@warwick.ac.uk (Rob McMahon) Organization: Computing Services, Warwick University, UK Lines: 36 In article <29250@news.Think.COM> barmar@think.COM (Barry Margolin) writes: >>Yes, it would. But the compiler writer would have been _seduced_ into that >>mistake by the standard. People are encouraged to think of == as testing >>for EQUALITY. In dpANS C, it appears that == does *NOT* have the properties >>of equality, and at the very least this needs to be said clearly and >>explicitly in the Rationale. > >This is only true if there can actually be non-interchangeable >representations for pointers to the same location. I'd expect the compiler >implementor for a system to know whether this is true, and implement the >optimizer accordingly. Who remembers the Burroughs B6700, which had (in Algol) POINTER A, B; IF A = B THEN ... vs IF A IS B THEN ... compiling to A B EQUL (sp?) vs. A B SAME Sigh. Those were the days ... Rob -- UUCP: ...!mcvax!ukc!warwick!cudcv PHONE: +44 203 523037 JANET: cudcv@uk.ac.warwick ARPA: cudcv@warwick.ac.uk Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England