C++ Logo

liaison

Advanced search

Re: [isocpp-wg14/wg21-liaison] P3248R0 Require [u]intptr_t

From: Aaron Ballman <aaron_at_[hidden]>
Date: Thu, 23 May 2024 08:57:19 -0400
On Thu, May 23, 2024 at 7:55 AM Ville Voutilainen
<ville.voutilainen_at_[hidden]> wrote:
>
> On Thu, 23 May 2024 at 14:47, Aaron Ballman via Liaison
> <liaison_at_[hidden]> wrote:
> >
> > On Thu, May 23, 2024 at 7:24 AM Robert Seacord via Liaison
> > <liaison_at_[hidden]> wrote:
> > >
> > > I cannot think of any reasons why this paper would cause any C/C++ compatibility issues.
> >
> > Aside from it meaning these C interfaces are mandatory in C++ but
> > optional in C. ;-)
>
> In <cstdint>, which is a C++ header and not a C header.
>
> I don't see a compatibility issue in this.

Committee members sometimes understand that the `<cfoo>` headers are
not feature-compatible with the <foo.h> headers in C; but my
experience with users is that they don't always see that distinction
so clearly. It's hard to explain to a user why:

#include <stdint.h>
intptr_t val;

doesn't compile for them in C++ while

#include <cstdint>
intptr_t val;

does, especially when C++ specifies that users who need their C++ code
to compile with a C compiler should use the C headers. That's where I
see the incompatibility. Also, WG14 rejected the paper because
implementers said they couldn't support it (see the minutes of the
discussion at https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3036.pdf)
-- instead we put it into TS 6010 so we could explore in more detail
whether it's possible to support. FWIW, Clang has no problems
supporting mandatory intptr_t to my knowledge.

~Aaron

Received on 2024-05-23 12:57:37