C++ Logo

std-proposals

Advanced search

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

From: Tiago Freire <tmiguelf_at_[hidden]>
Date: Mon, 27 Jan 2025 14:26:08 +0000
Again.
What do you think this would achieve?
There's nothing that is being hold back on common CPUs.
Even if you were to standardize "all pointers have exactly the same size" (which wouldn't change much in practice), this wouldn't do anything regarding alignment, and the following example:

    char c;
    long double *p = &c;
    char *p2 = p;
    *p2 = 'a';

That you brought out as an example of what you actually want to do. Would still be ill formed code, for reasons that got nothing to do with the size of the pointer.
Bringing exotic architectures into the mix and saying that they don't exist anymore is a red herring, this is bad code on x86_64 or arm64. No exotics required.



-----Original Message-----
From: Std-Proposals <std-proposals-bounces_at_lists.isocpp.org> On Behalf Of Frederick Virchanza Gotham via Std-Proposals
Sent: Monday, January 27, 2025 2:54 PM
To: std-proposals_at_lists.isocpp.org
Cc: Frederick Virchanza Gotham <cauldwell.thomas_at_gmail.com>
Subject: Re: [std-proposals] Make all data pointers intercompatible

On Mon, Jan 27, 2025 at 12:56 PM Bo Persson via Std-Proposals <std-proposals_at_lists.isocpp.org> wrote:
>
> The system was too old for a C++ compiler, but it did have C, and
> those languages are defined to support such architectures. So the odd
> languages rules are not there by chance, but because the language
> designers knew that they were needed.


If I had been on the C committee back then, I would have supported the support of these strange computers.

But today in 2025, C++ is being held back by the notion of computers that have gone extinct. Now we should just make all data pointers equal (or perhaps even go a step further and make function pointers equal to data pointers too -- because I don't think there's a C++23 compiler alive nowadays that has different size data and function pointers).
--
Std-Proposals mailing list
Std-Proposals_at_lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2025-01-27 14:26:17