From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id E2F443858403 for ; Mon, 25 Jul 2022 09:07:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E2F443858403 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-505-VAaPOgzSPtO02uRW7an8VQ-1; Mon, 25 Jul 2022 05:07:52 -0400 X-MC-Unique: VAaPOgzSPtO02uRW7an8VQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CA4CB102BCDD; Mon, 25 Jul 2022 09:07:51 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.195]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D811E1121314; Mon, 25 Jul 2022 09:07:50 +0000 (UTC) From: Florian Weimer To: Tom Honermann via Libc-alpha Cc: Tom Honermann , Adhemerval Zanella Subject: Re: [PATCH] stdlib: Suppress gcc diagnostic that char8_t is a keyword in C++20 in uchar.h. References: <20220724051143.1893401-1-tom@honermann.net> Date: Mon, 25 Jul 2022 11:07:48 +0200 In-Reply-To: <20220724051143.1893401-1-tom@honermann.net> (Tom Honermann via Libc-alpha's message of "Sun, 24 Jul 2022 01:11:43 -0400") Message-ID: <87fsipsgpn.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2022 09:07:55 -0000 * 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 =E2=80=98char8_t=E2=80=99 is a keyword in C++20 [-W= c++20-compat] > This change modifies the uchar.h header to suppress the diagnostic throug= h > 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 effec= t > 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