pointer representation (was: Re: effect of free())

Rob McMahon cudcv at warwick.ac.uk
Fri Sep 15 07:55:08 AEST 1989


In article <29250 at news.Think.COM> barmar at 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 at uk.ac.warwick             ARPA:   cudcv at warwick.ac.uk
Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England



More information about the Comp.lang.c mailing list