C++ Logo

std-proposals

Advanced search

[std-proposals] Make all data pointers intercompatible

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Thu, 9 May 2024 10:01:31 +0100
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?

Note that I'm not talking about code pointers here (i.e. I'm
maintaining the distinction between data pointers and code pointers).

Received on 2024-05-09 09:01:44