home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / cplus / 18201 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.3 KB  |  34 lines

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