home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!taumet!steve
- From: steve@taumet.com (Steve Clamage)
- Subject: Re: What is this CFRONT 3.0 warning message trying to tell me?
- Message-ID: <1992Dec18.174159.816@taumet.com>
- Organization: TauMetric Corporation
- References: <1992Dec15.183649.20994@delfin.com> <BzBzL2.5rx@apollo.hp.com> <1992Dec17.184841.4563@cadkey.com>
- Date: Fri, 18 Dec 1992 17:41:59 GMT
- Lines: 23
-
- erics@cadkey.com (Eric Smith) writes:
-
- >In article <BzBzL2.5rx@apollo.hp.com> vinoski@ch.apollo.hp.com (Stephen Vinoski) writes:
- > ...
- >> if (this != &rhs) {
- >> ...
-
- >Isn't there a problem with this code, since it checks to see if this
- >is the same as the right hand side by pointer comparison? Aren't
- >pointer comparisons only defined if they point within the same object
- >or array of objects?
-
- >My reading of the ARM (section 5.9) says that this comparison is
- >undefined (or rather implementation dependent). ANSI C (actually, I'm
- >looking in the ISO document, I'm not sure if the section numbers are
- >the same) has similiar language in 6.3.8 and 6.3.9.
-
- No, read those sections again. You can compare any two pointers of
- compatible type for equality (or inequality). It is the other
- comparisons ( > >= < <= ) which have additional restrictions.
- --
-
- Steve Clamage, TauMetric Corp, steve@taumet.com
-