home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / std / cplus / 1922 < prev    next >
Encoding:
Text File  |  1992-12-25  |  1.5 KB  |  42 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.3795@mulga.cs.mu.OZ.AU>
  6. Sender: news@cs.mu.OZ.AU
  7. Organization: Computer Science, University of Melbourne, Australia
  8. References: <1992Dec16.201044.2968@microsoft.com> <1992Dec18.193554.18588@ucc.su.OZ.AU> <1gtblgINN72@darkstar.UCSC.EDU> <1992Dec22.002957.25597@ucc.su.OZ.AU>
  9. Date: Fri, 25 Dec 1992 16:35:27 GMT
  10. Lines: 30
  11.  
  12. maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
  13.  
  14. >daniel@cse.ucsc.edu (Daniel R. Edelson) writes:
  15. [...]
  16. >>Thus, this property need not be true in any program that
  17. >>calls the operating system.
  18. >
  19. >    That is in the spirit of what I wanted, but I'm
  20. >not sure if a standard can say it in those words. Besides,
  21. >I wanted to be more explicit: even if I do an operting
  22. >system call somewhere, I want the system
  23. >to guarrantee
  24. >
  25. >    T* p=new T;
  26. >    T* q=p;
  27. >    if(!(p==q))cout<"Non conforming program";
  28.  
  29. I'm afraid that this is not possible.
  30. For proof, consider the following hypothetical operating system call:
  31.  
  32.     random_poke() : sets a random memory location to a random value
  33.  
  34. After calling this operating system call, you can make NO further guarantees
  35. about the behaviour of your system.
  36.  
  37. -- 
  38. Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
  39. This .signature virus is a self-referential statement that is true - but 
  40. you will only be able to consistently believe it if you copy it to your own
  41. .signature file!
  42.