From patchwork Sun Jul 24 05:11:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tom Honermann X-Patchwork-Id: 56286 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A25403857B8B for ; Sun, 24 Jul 2022 05:12:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A25403857B8B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1658639536; bh=Jx07ozd1eNYam87zenalibIqLrmQjX6rYSwsAAobyrk=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=A10R9PNfFPnbnB1tEPPOHm2+fPftMJLYjOM7KUYQGTmcOco6hhoAANZEyTH69l/dW 12y1Kg/iH9lJ00ub1VTdK+3HMlvt9t10+JYpIdQCS2wtHZ82yws08SrQKpXcjYeDal dUKG6HmIvfV4sHO7L8jr9Mgc4gJFlZr+iy/HGEgQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from smtp112.ord1d.emailsrvr.com (smtp112.ord1d.emailsrvr.com [184.106.54.112]) by sourceware.org (Postfix) with ESMTPS id 58385385841F for ; Sun, 24 Jul 2022 05:11:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 58385385841F X-Auth-ID: tom@honermann.net Received: by smtp7.relay.ord1d.emailsrvr.com (Authenticated sender: tom-AT-honermann.net) with ESMTPSA id 6781C20074; Sun, 24 Jul 2022 01:11:54 -0400 (EDT) To: libc-alpha@sourceware.org Subject: [PATCH] stdlib: Suppress gcc diagnostic that char8_t is a keyword in C++20 in uchar.h. Date: Sun, 24 Jul 2022 01:11:43 -0400 Message-Id: <20220724051143.1893401-1-tom@honermann.net> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Classification-ID: 34ff5eef-49af-4782-ae7b-904f633a192e-1-1 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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-Patchwork-Original-From: Tom Honermann via Libc-alpha From: Tom Honermann Reply-To: Tom Honermann Cc: Tom Honermann Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "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 #ifndef __USE_ISOCXX11