home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.std.c++
- Path: sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh
- From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
- Subject: Re: Zero-length structures and pointer comparisons
- Message-ID: <9236103.3876@mulga.cs.mu.OZ.AU>
- Sender: news@cs.mu.OZ.AU
- Organization: Computer Science, University of Melbourne, Australia
- 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>
- Date: Fri, 25 Dec 1992 16:42:16 GMT
- Lines: 45
-
- maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
-
- >fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
- >>maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
- >>
- >>>pat@frumious.uucp (Patrick Smith) writes:
- >>>> p == q => ptrcmp(p,q) == 0
- >>>
- >>> I'm NOT agreeing with this at present. I reject any relationship
- >>>between p ? q and ptrcmp. On some machines any such relationship
- >>>might make ptrcmp unimplementable, and thus defeat the proposal completely.
- >>
- >>I remain unconvinced that such a relationship is unimplementable on
- >>some machines.
- >
- > On the 486 it is not in general possible to implement
- >the comparison p==q for arbitrary logical addresses. If p and q
- >are aliases only the operating system kernel could implement
- >the comparison, and if the OS happened not to support this,
- >p==q could not be implemented.
-
- *In general* this is true, but we are not talking about the general case.
- All that is required is that it be true for conformant C++ programs.
- This does not require checking whether segment aliases exist, it just requires
- ensuring that they won't occur for conformant C++ programs.
-
- >>>It is only Jims suggestion that ptrcmp might always return 0 that
- >>>makes it possible to make its existence mandatory.
- >>
- >>A ptrcmp that always returned 0 would be useless, IMHO.
- >
- > Not at all. My sort will still order the pointers
- >into the total order, which in this case is anything.
- >
- > This is entirely different from the current situation
- >where a sort based on the existing implementation defined <
- >on pointers might not terminate.
-
- Yes, you are correct. I retract that statement.
-
- --
- Fergus Henderson fjh@munta.cs.mu.OZ.AU
- This .signature virus is a self-referential statement that is true - but
- you will only be able to consistently believe it if you copy it to your own
- .signature file!
-