From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp112.ord1c.emailsrvr.com (smtp112.ord1c.emailsrvr.com [108.166.43.112]) by sourceware.org (Postfix) with ESMTPS id EB99A3858D28 for ; Wed, 20 Jul 2022 16:53:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EB99A3858D28 X-Auth-ID: tom@honermann.net Received: by smtp7.relay.ord1c.emailsrvr.com (Authenticated sender: tom-AT-honermann.net) with ESMTPSA id 035EDA0196; Wed, 20 Jul 2022 12:53:45 -0400 (EDT) Message-ID: <452ca120-6c56-d735-904c-74f357944ed7@honermann.net> Date: Wed, 20 Jul 2022 12:53:45 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v4 2/3] stdlib: Implement mbrtoc8(), c8rtomb(), and the char8_t typedef. Content-Language: en-US To: Florian Weimer , Adhemerval Zanella Netto Cc: Adhemerval Zanella Netto via Libc-alpha , Joseph Myers References: <20220630125215.6052-1-tom@honermann.net> <20220630125215.6052-3-tom@honermann.net> <5bcf2650-0cf0-6f67-a532-b47e3daffdda@linaro.org> <878ronlwiy.fsf@oldenburg.str.redhat.com> <874jzblt8b.fsf@oldenburg.str.redhat.com> From: Tom Honermann In-Reply-To: <874jzblt8b.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Classification-ID: 97acc6cb-64bc-4fc9-a15c-8ee48bd15695-1-1 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: Wed, 20 Jul 2022 16:53:48 -0000 On 7/20/22 11:05 AM, Florian Weimer wrote: > * Adhemerval Zanella Netto: > >>> I think __cpp_char8_t is only defined if the language mode is active. >>> The warning is independent of the language mode, though. >> Maybe we also skip chat8_t definition for __cplusplus == 202002L ? > We have to do that in any case, but we still need to deal with the > warning in the earlier language modes. Declaring the char8_t typedef (and related mbrtoc8 and c8rtomb functions) in C++ modes that don't enable the builtin char8_t type (including -std=c++20 -fno-char8_t) is beneficial for compatibility with C in C23 or _GNU_SOURCE modes. Tom. > > Thanks, > Florian >