From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 13610385829F for ; Wed, 27 Jul 2022 23:20:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 13610385829F 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.93,196,1654588800"; d="scan'208";a="83107721" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 27 Jul 2022 15:20:07 -0800 IronPort-SDR: ug6uBFgG5qBoWKGUJhfjjpvz8MWACefTrsgJ5qEd8LgdCLSNpsR3UAwlBMLh5P3hsu33SyI2b9 s7Ky3pimuADD2MN+MaLU6GGV9oIwigmXCtHIKhZfvyDgdj+ugEbRsVfJ0ciqI60b8Z8iB39O6O sGl84wXSVsO4I+SxJ74GFY5jQ9Dg3M6N2Seg3SQK0SyqxZhDkL4yMDk/A+vLUiDFzHnNojXhNm QG5OnrF+BPzcJJ/tMOC2PP0kB/uf3+GHc3fauUexF2gYaNbu8mLQUNnx7l2M+9bk38oKqf4ysp 6+A= Date: Wed, 27 Jul 2022 23:20:02 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Tom Honermann CC: Subject: Re: [PATCH 1/3] C: Implement C2X N2653 char8_t and UTF-8 string literal changes In-Reply-To: <20220725175948.1424695-2-tom@honermann.net> Message-ID: References: <20220725175948.1424695-1-tom@honermann.net> <20220725175948.1424695-2-tom@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-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-3118.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2022 23:20:09 -0000 On Mon, 25 Jul 2022, Tom Honermann via Gcc-patches wrote: > diff --git a/gcc/ginclude/stdatomic.h b/gcc/ginclude/stdatomic.h > index bfcfdf664c7..75ed7965689 100644 > --- a/gcc/ginclude/stdatomic.h > +++ b/gcc/ginclude/stdatomic.h > @@ -49,6 +49,10 @@ typedef _Atomic long atomic_long; > typedef _Atomic unsigned long atomic_ulong; > typedef _Atomic long long atomic_llong; > typedef _Atomic unsigned long long atomic_ullong; > +#if (defined(__CHAR8_TYPE__) \ > + && (defined(_GNU_SOURCE) || defined(_ISOC2X_SOURCE))) > +typedef _Atomic __CHAR8_TYPE__ atomic_char8_t; > +#endif > typedef _Atomic __CHAR16_TYPE__ atomic_char16_t; > typedef _Atomic __CHAR32_TYPE__ atomic_char32_t; > typedef _Atomic __WCHAR_TYPE__ atomic_wchar_t; GCC headers don't test glibc feature test macros such as _GNU_SOURCE and _ISOC2X_SOURCE; they base things only on the standard version (whether directly, or indirectly as via __CHAR8_TYPE__) and standard-defined feature test macros. (There's one exception in glimits.h - testing __USE_GNU, the macro defined internally by glibc's headers - but I don't think that's something we want to emulate in new code.) -- Joseph S. Myers joseph@codesourcery.com