public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tom Honermann <tom@honermann.net>
To: Joseph Myers <joseph@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 1/3] C: Implement C2X N2653 char8_t and UTF-8 string literal changes
Date: Sat, 30 Jul 2022 19:17:07 -0400	[thread overview]
Message-ID: <a0022256-c1d6-a679-73e5-7d8de5a694eb@honermann.net> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2207272317340.564321@digraph.polyomino.org.uk>

On 7/27/22 7:20 PM, Joseph Myers wrote:
> 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.

Ok, thank you, that makes sense. I'll follow up with a revised patch 
that removes the additional conditions.

Tom.

>
> (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.)
>

  reply	other threads:[~2022-07-30 23:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25 17:59 [PATCH 0/3] Implement C2X N2653 (char8_t) and correct UTF-8 character literal type in preprocessor directives for C++ Tom Honermann
2022-07-25 17:59 ` [PATCH 1/3] C: Implement C2X N2653 char8_t and UTF-8 string literal changes Tom Honermann
2022-07-27 23:20   ` Joseph Myers
2022-07-30 23:17     ` Tom Honermann [this message]
2022-08-01 18:32   ` [PATCH 1/3 v2] " Tom Honermann
2022-07-25 17:59 ` [PATCH 2/3] testsuite: Add tests for " Tom Honermann
2022-07-27 23:23   ` Joseph Myers
2022-07-31 21:47     ` Tom Honermann
2022-08-01 18:34   ` [PATCH 2/3 v2] " Tom Honermann
2022-08-01 19:13     ` Joseph Myers
2022-08-01 22:36       ` Tom Honermann
2022-08-01 22:39   ` [PATCH 2/3 v3] " Tom Honermann
2022-08-02 16:53     ` Joseph Myers
2022-08-02 18:02       ` Tom Honermann
2022-07-25 17:59 ` [PATCH 3/3] c++/106426: Treat u8 character literals as unsigned in char8_t modes Tom Honermann
2022-07-25 18:05   ` Andrew Pinski
2022-07-26  1:32     ` [PATCH 3/3 v2] preprocessor/106426: " Tom Honermann
2022-07-26  1:38     ` [PATCH 3/3] c++/106426: " Tom Honermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a0022256-c1d6-a679-73e5-7d8de5a694eb@honermann.net \
    --to=tom@honermann.net \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).