From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 528E23858D20 for ; Mon, 28 Feb 2022 23:01:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 528E23858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.90,144,1643702400"; d="scan'208";a="72554575" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 28 Feb 2022 15:01:40 -0800 IronPort-SDR: TUPsVe1I/lpnsx9SQ0a3BoaVdG0SGqJH7sGmranz02GPRqINny8Z0EGiKP3YJfArdKzKrlaj5M hhwbFfGUkaQl75+OIExHdzk/oH2lFOfgLEFltSdJz+lvpEybbifYBR8PevYho2IgbQnFSaEEw+ UxSw4KzmWfI+lov9BNPVphY3W1JVtY6M/xet1MmrvbAnjnIeSbIHVsP7HpfmtF3q0y+/AnX4zw UVHWQu/bBq0CKF+edfCbiVfThVe9ficwEXucM3h0o2bHERT9EldXl7s11QI4gzg58yvghqtNnm qro= Date: Mon, 28 Feb 2022 23:01:35 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Tom Honermann CC: libc-alpha Subject: Re: [PATCH 2/3]: C++20 P0482R6 and C2X N2653: Implement mbrtoc8, c8rtomb, char8_t In-Reply-To: <57610f50-dd95-fd32-1102-5f1cda440891@honermann.net> Message-ID: References: <57610f50-dd95-fd32-1102-5f1cda440891@honermann.net> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-3114.5 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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, 28 Feb 2022 23:01:43 -0000 On Sun, 27 Feb 2022, Tom Honermann via Libc-alpha wrote: > This patch provides implementations for the mbrtoc8 and c8rtomb functions > adopted for C++20 via WG21 P0482R6 [1] and for C2X via WG14 N2653 [2]. It also > provides the char8_t typedef adopted for C2X via WG14 N2653 [2]. > > The mbrtoc8 and c8rtomb functions are declared in uchar.h in C2X mode or when > the _GNU_SOURCE macro or C++20 __cpp_char8_t feature test macro is defined. > > The char8_t typedef is declared in uchar.h in C2X mode or when the _GNU_SOURCE > macro is defined and the C++20 __cpp_char8_t feature test macro is not defined > (if __cpp_char8_t is defined, then char8_t is a builtin type). You should almost never have "defined __USE_GNU || ..." in header conditionals, because _GNU_SOURCE implies the other feature test macros. -- Joseph S. Myers joseph@codesourcery.com