Article View: comp.std.c++
Article #1136Re: Zero-length structures and pointer comparisons
From: John MAX Skaller
Date: Tue, 22 Dec 1992 00:37
Date: Tue, 22 Dec 1992 00:37
38 lines
2111 bytes
2111 bytes
In article <9235622.25712@mulga.cs.mu.OZ.AU> 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.
>
>>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.
--
;----------------------------------------------------------------------
JOHN (MAX) SKALLER, maxtal@extro.ucc.su.oz.au
Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
Technical Details
Message-ID:
<1992Dec22.003752.26023@ucc.su.OZ.AU>Path:
arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtalReferences:
<BzCG7K.2sG@frumious.uucp> <1992Dec18.192202.17023@ucc.su.OZ.AU> <9235622.25712@mulga.cs.mu.OZ.AU>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c++ Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) Subject: Re: Zero-length structures and pointer comparisons Message-ID: <1992Dec22.003752.26023@ucc.su.OZ.AU> Sender: news@ucc.su.OZ.AU Nntp-Posting-Host: extro.ucc.su.oz.au Organization: MAXTAL P/L C/- University Computing Centre, Sydney References: <BzCG7K.2sG@frumious.uucp> <1992Dec18.192202.17023@ucc.su.OZ.AU> <9235622.25712@mulga.cs.mu.OZ.AU> Date: Tue, 22 Dec 1992 00:37:52 GMT Lines: 38