Sujet : Re: Computer architects leaving Intel...
De : already5chosen (at) *nospam* yahoo.com (Michael S)
Groupes : comp.archDate : 11. Sep 2024, 17:52:21
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240911195221.00004881@yahoo.com>
References : 1 2 3 4 5 6 7 8 9
User-Agent : Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
On Wed, 11 Sep 2024 09:29:04 -0700
Tim Rentsch <
tr.17687@z991.linuxsc.com> wrote:
Josh Vanderhoof <x@y.z> writes:
[how to write a portable, UB-free check if mempcy() intervals overlap]
It is legal to test for equality between pointers to different
objects
Right. This observation is the key insight.
Real mode x86 C compilers operating in Large and Compact Models that
were popular on IBM-compatible PCs 30-40 years ago could have more than
one representation for the pointer to the same memory location. If my
memory serves me, the rules of pointers comparison for equality were
the same as rules of comparison for <>. In both cases for reliable
result pointers had to be explicitly normalized (i.e. converted from
'far' to 'huge' or something like that).
It was long time ago and even back then I didn't use Large model very
often, so it's possible that I misremember. But if I remember
correctly, does it mean that those C compilers now would be considered
non-compliant?