Sujet : Re: New VSI post on Youtube
De : johnrreagan (at) *nospam* earthlink.net (John Reagan)
Groupes : comp.os.vmsDate : 21. Aug 2024, 09:21:17
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <77842b73cf71703a6a5dfe45ac7b34b643d477be@i2pn2.org>
References : 1 2 3 4 5 6 7
User-Agent : Mozilla Thunderbird
On 8/15/2024 1:58 AM, Arne Vajhøj wrote:
On 8/14/2024 7:47 PM, Lawrence D'Oliveiro wrote:
On Wed, 14 Aug 2024 14:33:27 -0400, Arne Vajhøj wrote:
And it has different size of long and pointers.
>
If you wanted an integer type that is compatible with pointers, that was
always intptr_t and uintptr_t, surely
I am not being particular clear.
I am not saying that:
default sizeof long C++ x64 <> default sizeof pointer C++ x64
I am saying that:
default sizeof long C++ x64 <> default sizeof long C++ Itanium & Alpha
default sizeof pointer C++ x64 <> default sizeof pointer C++ Itanium & Alpha
and later:
default sizeof long C++ x64 <> default sizeof long C x64
default sizeof pointer C++ x64 <> default sizeof pointer C x64
Arne
Yes, all good points. The size_t and offset_t = 32-bits and ptrdiff_t = 32-bits on Alpha/Itanium started the mess years ago.
Personally, I would have kept all the defaults the same as Itanium but got "convinced" to go wider. The first attempt was ONLY 64-bit pointers on x86 with C++ but things like those pesky descriptors and itemlists got in the way.
I did suggest an LP64, ILP32, etc qualifier but mostly got blank stares from other engineers as "too nerdy"
long == 64-bits has caused us to make changes as prior header writers assumed that long was 32-bits. They should have all followed Arne's advice and used int32_t and int64_t when specifying their ABIs.
I'll can take some ownership on the changes, but I suffered with years of "John, why is size_t 32-bits? Why does subtracting two 64-bit pointers only give me a 32-bit result?"