>I'm not saying that we should ever >dereference an unaligned pointer.
>All I'm asking for is that pointer arithmetic >will be well-defined forCorrect....the only missing thing is the guarantee that it works same way on all platfroms.
>By the way I do realise that this will all fall >apart when it comes to
>"pointer tagging". If someone uses the lower >3 bits of a pointer to
>store extra info, and if I then relocate the >object into unaligned
>memory and do arithmetic on a pointer inside >it, then I'll corrupt the
>pointer tag. I realise that.
That's not a problem, because if you want to tag a pointer you need to wrap it inside a structure, and you can delete all member operators that modify the pointer value inside that structure.
And when you want to get the raw pointer back, you just mask out the tag bits, and get the pointer bits intact.
Maybe you should reformulate your thread's question. Instead of asking for the feature, maybe ask who is breaking it, if there is none, then it can be standardized.
-------- Original message --------
From: Frederick Virchanza Gotham via Std-Proposals <std-proposals@lists.isocpp.org>
Date: 1/29/25 1:39 PM (GMT+01:00)
To: std-proposals@lists.isocpp.org
Cc: Frederick Virchanza Gotham <cauldwell.thomas@gmail.com>
Subject: Re: [std-proposals] Make all data pointers intercompatible
On Tue, Jan 28, 2025 at 3:40 PM Jens Maurer wrote: