C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Make all data pointers intercompatible

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Thu, 9 May 2024 10:15:21 +0100
On Thu, 9 May 2024 at 10:03, Frederick Virchanza Gotham via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> In the past I've heard of C/C++ compilers that have a char* that's
> bigger than an int* -- because the char pointer is a memory address
> plus a numerical offset (0 - 3) into a word. In the real world though
> I've never encountered such a compiler but I'll believe the rumour.
> The closest to this I've ever encountered is the Texas Instruments
> F28069 microcontroller whose smallest addressable unit of memory is 16
> bits. When they were designing the compiler for the F28069, they could
> have provided 8-Bit char's, and then a char* would need to be bigger
> than an int*, but instead they just decided to make CHAR_BIT == 16,
> meaning that all data pointers are the same size.
>
> So, If there is no extant C++23 compiler nowadays that has a char*
> that's bigger than any other data pointer, then would it make sense in
> the C++26 standard to say that all data pointers are intercompatible?
>

As usual, you haven't provided a reason why doing that would be useful. All
you've said is it might be possible.



> Note that I'm not talking about code pointers here (i.e. I'm
> maintaining the distinction between data pointers and code pointers).
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2024-05-09 09:16:40