[ub] Justification for < not being a total order on pointers?

Nevin Liber nevin at eviloverlord.com
Fri Oct 18 04:30:20 CEST 2013


On 17 October 2013 19:18, Gabriel Dos Reis <gdr at axiomatics.org> wrote:

>
> The implication in question is this:
>
>    p == q => intptr_t(p) == intptr_t(q)
>
> where p and q are pointers.  I am having trouble following how,  even on
> such exotic architecture, the implication will be affected.
>

I can imagine that on a system concerned with security where
sizeof(intptr_t) > sizeof(p) random salt is added to the intptr_t
conversion which is removed when converting back to the pointer type.


> I suppose the other implication that is on the mind of many people but
> not being discussed is
>
>    p != q => intptr_t(p) != intptr_t(q)


I'm not concerned about that, as p -> intptr_t(p) -> p has to result in a
matching pointer. I don't see how that is workable if the implication above
fails.
-- 
 Nevin ":-)" Liber  <mailto:nevin at eviloverlord.com>  (847) 691-1404
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.open-std.org/pipermail/ub/attachments/20131017/8060fc61/attachment-0001.html 


More information about the ub mailing list