home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / std / cplus / 1923 < prev    next >
Encoding:
Text File  |  1992-12-25  |  2.3 KB  |  57 lines

  1. Newsgroups: comp.std.c++
  2. Path: sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh
  3. From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
  4. Subject: Re: Zero-length structures and pointer comparisons
  5. Message-ID: <9236103.3876@mulga.cs.mu.OZ.AU>
  6. Sender: news@cs.mu.OZ.AU
  7. Organization: Computer Science, University of Melbourne, Australia
  8. References: <BzCG7K.2sG@frumious.uucp> <1992Dec18.192202.17023@ucc.su.OZ.AU> <9235622.25712@mulga.cs.mu.OZ.AU> <1992Dec22.003752.26023@ucc.su.OZ.AU>
  9. Date: Fri, 25 Dec 1992 16:42:16 GMT
  10. Lines: 45
  11.  
  12. maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
  13.  
  14. >fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
  15. >>maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
  16. >>
  17. >>>pat@frumious.uucp (Patrick Smith) writes:
  18. >>>>   p == q   =>   ptrcmp(p,q) == 0
  19. >>>
  20. >>>    I'm NOT agreeing with this at present. I reject any relationship
  21. >>>between p ? q and ptrcmp. On some machines any such relationship
  22. >>>might make ptrcmp unimplementable, and thus defeat the proposal completely.
  23. >>
  24. >>I remain unconvinced that such a relationship is unimplementable on
  25. >>some machines.
  26. >
  27. >    On the 486 it is not in general possible to implement
  28. >the comparison p==q for arbitrary logical addresses. If p and q
  29. >are aliases only the operating system kernel could implement 
  30. >the comparison, and if the OS happened not to support this,
  31. >p==q could not be implemented.
  32.  
  33. *In general* this is true, but we are not talking about the general case.
  34. All that is required is that it be true for conformant C++ programs.
  35. This does not require checking whether segment aliases exist, it just requires
  36. ensuring that they won't occur for conformant C++ programs.
  37.  
  38. >>>It is only Jims suggestion that ptrcmp might always return 0 that
  39. >>>makes it possible to make its existence mandatory.
  40. >>
  41. >>A ptrcmp that always returned 0 would be useless, IMHO.
  42. >
  43. >    Not at all. My sort will still order the pointers
  44. >into the total order, which in this case is anything.
  45. >
  46. >    This is entirely different from the current situation
  47. >where a sort based on the existing implementation defined <
  48. >on pointers might not terminate.
  49.  
  50. Yes, you are correct. I retract that statement.
  51.  
  52. -- 
  53. Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
  54. This .signature virus is a self-referential statement that is true - but 
  55. you will only be able to consistently believe it if you copy it to your own
  56. .signature file!
  57.