From: Florian Weimer <fweimer@redhat.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: <libc-alpha@sourceware.org>
Subject: Re: Do not define static_assert or thread_local in headers for C2x
Date: Wed, 07 Sep 2022 20:15:06 +0200 [thread overview]
Message-ID: <87czc7oxud.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2209071514330.876631@digraph.polyomino.org.uk> (Joseph Myers's message of "Wed, 7 Sep 2022 15:15:26 +0000")
* Joseph Myers:
> C2x makes static_assert and thread_local into keywords, removing the
> definitions as macros in assert.h and threads.h. Thus, disable those
> macros in those glibc headers for C2x.
>
> The disabling is done based on a combination of language version and
> __GNUC_PREREQ, *not* based on __GLIBC_USE (ISOC2X), on the principle
> that users of the header (when requesting C11 or later APIs - not
> assert.h for C99 and older API versions) should always have the names
> static_assert or thread_local available after inclusion of the header,
> whether as a keyword or as a macro. Thus, when using a compiler
> without the keywords (whether an older compiler, possibly in C2x mode,
> or _GNU_SOURCE with any compiler but in an older language mode, for
> example) the macros should be defined, even when C2x APIs have been
> requested. The __GNUC_PREREQ conditionals here may well need updating
> with the versions of other compilers that gained support for these
> keywords in C2x mode.
Looks reasonable, thanks.
The internal definition of _Static_assert in include/sys/cdefs.h is not
affected.
Florian
prev parent reply other threads:[~2022-09-07 18:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-07 15:15 Joseph Myers
2022-09-07 18:15 ` Florian Weimer [this message]
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=87czc7oxud.fsf@oldenburg.str.redhat.com \
--to=fweimer@redhat.com \
--cc=joseph@codesourcery.com \
--cc=libc-alpha@sourceware.org \
/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).