pointer equality (was: Re: pointer representation (was: ...))
David Levine
davidl at intelob.intel.com
Wed Sep 20 00:25:21 AEST 1989
In article <10840 at riks.csl.sony.co.jp> diamond at csl.sony.co.jp (Norman Diamond) writes:
> In article <2079 at munnari.oz.au> ok at cs.mu.oz.au (Richard O'Keefe) writes:
> >People are encouraged to think of == as testing for EQUALITY.
> >In dpANS C, [in the case of pointers] 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.
>
> In fact, it calls for a note in the Standard, in the section defining
> the == operator. Surely no one can claim that this effect of the rule
> is obvious, or that it yields the least surprising results.
I'm sorry, I must have missed something. I was on vacation for two
weeks; perhaps the referenced article expired. Now I've waited almost
a week for someone to follow this one up, but apparently nobody else
is, so:
Why do you claim that == doesn't test for equality on pointers? The
dpANS tells us that two pointers are equal if they point to the same
object; isn't that the only possible portable definition of pointer
equality? (I DON'T want a definition of pointer equality that
compares bit patterns.)
As I said, perhaps I've missed something.
David D. Levine BBBBBBBBB IIII IIII NNN NNNN TM
Senior Technical Writer BBBB BBBB iiii iiii NNNN NNNN
BBBBBBBBB IIII IIII NNNNNNNNN
UUCP: ...[!uunet]!tektronix!biin!davidl BBBB BBBB IIII IIII NNNN NNNN
MX-Internet: <davidl at intelob.intel.com> BBBBBBBBB IIII IIII NNNN NNN
ARPA: <@iwarp.intel.com:davidl at intelob.intel.com>
More information about the Comp.lang.c
mailing list