public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Tom Honermann <tom@honermann.net>
To: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>,
	Florian Weimer <fweimer@redhat.com>,
	Tom Honermann via Libc-alpha <libc-alpha@sourceware.org>
Subject: Re: [PATCH] stdlib: Suppress gcc diagnostic that char8_t is a keyword in C++20 in uchar.h.
Date: Mon, 1 Aug 2022 12:24:44 -0400	[thread overview]
Message-ID: <6b5b4d3c-b38e-f319-fdf5-dbeaf43ede9f@honermann.net> (raw)
In-Reply-To: <b158487c-8976-7b02-aa29-518835b2d56c@linaro.org>

On 8/1/22 11:48 AM, Adhemerval Zanella Netto wrote:
>
> On 01/08/22 12:27, Tom Honermann wrote:
>> On 8/1/22 9:38 AM, Adhemerval Zanella Netto wrote:
>>> On 29/07/22 15:22, Tom Honermann wrote:
>>>> On 7/25/22 8:34 AM, Adhemerval Zanella Netto via Libc-alpha wrote:
>>>>> On 25/07/22 06:07, Florian Weimer wrote:
>>>>>> * Tom Honermann via Libc-alpha:
>>>>>>
>>>>>>> gcc 13 issues the following diagnostic for the uchar.h header when the
>>>>>>> -Wc++20-compat option is enabled in C++ modes that do not enable char8_t
>>>>>>> as a builtin type (C++17 and earlier by default; subject to _GNU_SOURCE
>>>>>>> and the gcc -f[no-]char8_t option).
>>>>>>>      warning: identifier ‘char8_t’ is a keyword in C++20 [-Wc++20-compat]
>>>>>>> This change modifies the uchar.h header to suppress the diagnostic through
>>>>>>> the use of '#pragma GCC diagnostic' directives for gcc 10 and later (the
>>>>>>> -Wc++20-compat option was added in gcc version 10).  Unfortunately, a bug
>>>>>>> in gcc currently prevents those directives from having the intended effect
>>>>>>> as reported at https://gcc.gnu.org/PR106423.  A patch for that issue has
>>>>>>> been submitted and is available in the email thread archive linked below.
>>>>>>>      https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598736.html
>>>>>>> ---
>>>>>>>     wcsmbs/uchar.h | 8 ++++++++
>>>>>>>     1 file changed, 8 insertions(+)
>>>>>>>
>>>>>>> diff --git a/wcsmbs/uchar.h b/wcsmbs/uchar.h
>>>>>>> index c37e8619a0..5f7139f279 100644
>>>>>>> --- a/wcsmbs/uchar.h
>>>>>>> +++ b/wcsmbs/uchar.h
>>>>>>> @@ -34,8 +34,16 @@
>>>>>>>     /* Declare the C2x char8_t typedef in C2x modes, but only if the C++
>>>>>>>       __cpp_char8_t feature test macro is not defined.  */
>>>>>>>     #if __GLIBC_USE (ISOC2X) && !defined __cpp_char8_t
>>>>>>> +#if __GNUC_PREREQ (10, 0) && defined __cplusplus
>>>>>>> +/* Suppress the diagnostic regarding char8_t being a keyword in C++20.  */
>>>>>>> +# pragma GCC diagnostic push
>>>>>>> +# pragma GCC diagnostic ignored "-Wc++20-compat"
>>>>>>> +#endif
>>>>>>>     /* Define the 8-bit character type.  */
>>>>>>>     typedef unsigned char char8_t;
>>>>>>> +#if __GNUC_PREREQ (10, 0) && defined __cplusplus
>>>>>>> +# pragma GCC diagnostic pop
>>>>>>> +#endif
>>>>>>>     #endif
>>>>>> Patch looks okay to me.  The warning was introduced in GCC 10.
>>>>>>
>>>>>> This needs RM approval at this point, I think.
>>>>>>
>>>>>> Thanks,
>>>>>> Florian
>>>>>>
>>>>> This is ok for 2.36, thanks.
>>>> Thanks. Please commit on my behalf; I don't have commit access.
>>>>
>>>> Tom.
>>>>
>>> Ack, done.
>> Thank you! Should this (and H.J. Lu's "missing test-c8rtomb/test-mbrtoc8 dependency" patch) be merged for 2.36? Both appear to have been approved for 2.36 but I don't see them on the release/2.36/master branch at the moment.
> I think I did it [1].

Looks, good, thank you!

Tom.

>
> [1] https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/release/2.36/master

  reply	other threads:[~2022-08-01 16:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-24  5:11 Tom Honermann
2022-07-25  9:07 ` Florian Weimer
2022-07-25 12:34   ` Adhemerval Zanella Netto
2022-07-29 18:22     ` Tom Honermann
2022-08-01 13:38       ` Adhemerval Zanella Netto
2022-08-01 15:27         ` Tom Honermann
2022-08-01 15:48           ` Adhemerval Zanella Netto
2022-08-01 16:24             ` Tom Honermann [this message]
2022-08-17 15:11 ` Tom Honermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6b5b4d3c-b38e-f319-fdf5-dbeaf43ede9f@honermann.net \
    --to=tom@honermann.net \
    --cc=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).