From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe34.google.com (mail-vs1-xe34.google.com [IPv6:2607:f8b0:4864:20::e34]) by sourceware.org (Postfix) with ESMTPS id 2973F38582A5 for ; Mon, 1 Aug 2022 15:49:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2973F38582A5 Received: by mail-vs1-xe34.google.com with SMTP id d187so11676840vsd.10 for ; Mon, 01 Aug 2022 08:49:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:organization:in-reply-to :content-transfer-encoding; bh=dZh+fFIyh86K/b1tSEZIkYSsFeh7h2TvF+Lf/N+QA0I=; b=F1nljSaWBULTnEMLrvHEHc8qy2kERMKPLdJopUeL7bdepfc7+4YUzu0RDeIs8873l3 cBQZGS71qcZoZdcIrNux5R7C2ZQoBBcyT+zzyGhkrEN3ShBO0qqL3krLP+LnEtouroee WcuIBQKJtIJRZ0ZAbQtWC5yxJ3ESTZXLR/TA+n0Lnb+WJfYcvjSUw6DfSZ2VcicSMxhr 4UQqVTQIoRJVpLdb8OEzwnqhTahjRqhD/w3JbBfJjkrMGKUplcQoDGl/0O0hKaQODkqm xMWGY14Kjvm1nnErTXSuWYg74mqrkhM0ubga55kEC137BUUlKL7x7jFUWY8SS32ssQbX 9JRA== X-Gm-Message-State: ACgBeo1zneEtbnwasao18kjUGtZ3Cw91mfcUeeUrk41u0BcFsRhh+xSs WzxY9muR0qxKds8M6c/rPHLi74qHGf3OlQ== X-Google-Smtp-Source: AA6agR7i1zbFNAilp6m87FvGYuGUd+Z3xGjA7BZFDcp7MhI1X08mub3oaAtZyeT7oZyFz/sOKGFgGw== X-Received: by 2002:a05:6102:3570:b0:37c:e2d1:5c5a with SMTP id bh16-20020a056102357000b0037ce2d15c5amr3077293vsb.30.1659368941447; Mon, 01 Aug 2022 08:49:01 -0700 (PDT) Received: from ?IPV6:2804:431:c7cb:1e34:d541:f280:24d8:b04c? ([2804:431:c7cb:1e34:d541:f280:24d8:b04c]) by smtp.gmail.com with ESMTPSA id l5-20020ab05a05000000b00384293c4199sm6634288uad.23.2022.08.01.08.49.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Aug 2022 08:49:01 -0700 (PDT) Message-ID: Date: Mon, 1 Aug 2022 12:48:58 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.1.0 Subject: Re: [PATCH] stdlib: Suppress gcc diagnostic that char8_t is a keyword in C++20 in uchar.h. Content-Language: en-US To: Tom Honermann , Florian Weimer , Tom Honermann via Libc-alpha References: <20220724051143.1893401-1-tom@honermann.net> <87fsipsgpn.fsf@oldenburg.str.redhat.com> <8a30983b-a69b-c8a2-df4d-04690e22bf21@linaro.org> <8ad1265f-04e3-3e1f-a7b4-7927b47d1e36@linaro.org> <37b8a0bd-a577-3ddd-9c72-93aea01f6e7d@honermann.net> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <37b8a0bd-a577-3ddd-9c72-93aea01f6e7d@honermann.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, NICE_REPLY_A, 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-List-Received-Date: Mon, 01 Aug 2022 15:49:04 -0000 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]. [1] https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/release/2.36/master