home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / std / cplus / 1827 < prev    next >
Encoding:
Text File  |  1992-12-17  |  2.1 KB  |  46 lines

  1. Newsgroups: comp.std.c++
  2. Path: sparky!uunet!titan!lpi!pkt
  3. From: pkt@lpi.liant.com (Scott Turner)
  4. Subject: Re: Zero-length structures and pointer comparisons
  5. Message-ID: <1992Dec17.150914.2783@lpi.liant.com>
  6. Sender: pkt@lpi (Scott Turner)
  7. Organization: Liant Software Corporation
  8. References: <1992Dec11.230534.10499@microsoft.com> <1992Dec15.162202.11231@ucc.su.OZ.AU>
  9. Date: Thu, 17 Dec 1992 15:09:14 GMT
  10. Lines: 34
  11.  
  12. In article <1992Dec15.162202.11231@ucc.su.OZ.AU> John (Max) Skaller writes:
  13. > In article <1992Dec11.230534.10499@microsoft.com> Jim Adcock writes:
  14. > >No more nor less than any other virtual memory OS that allows
  15. > >multiply mapped pages.  Since there is no functionality in the
  16. > >language requiring such multiply mapped pages, you only get in
  17. > >this situation by invoking some system dependency, in which case
  18. > >you are making use of implementation dependencies.
  19.  
  20. > But Jim, it is not implementation defined, it is required that 
  21. > pointers to the same object compare equal.
  22.  
  23. > It is therefore not
  24. > allowed to do this sort of memory mapping in C++ behind the scenes,
  25. > which is what I'm concerned with...we actually want to.
  26.  
  27. It makes me uneasy, but I think Jim Adcock is correct: an implementation
  28. can define an extension, such as memory mapping, which overrides the usual
  29. execution time rules of C/C++, including the rule that pointers to the same
  30. object compare equal.  The rule that 1+1==2 would likewise be subject to
  31. "extension".
  32.  
  33. Nevertheless, the C standard implies that the onus is on the invoker of memory 
  34. mapping to be aware of libraries and other code which may rely on the usual
  35. execution time rules of C/C++, such as the rule that pointers to the same
  36. object compare equal.  If we don't want libraries to make that assumption,
  37. then John (Max) Skaller is also correct to say
  38.  
  39. > So the question is really whether the requirement that pointers to
  40. > the same object compare equal should be left implementation defined.
  41. --
  42. Prescott K. Turner, Jr.
  43. Liant Software Corp. (developers of LPI languages)
  44. 959 Concord St., Framingham, MA 01701 USA    (508) 872-8700
  45. UUCP: uunet!lpi!pkt                          Internet: pkt@lpi.liant.com
  46.