From: Jonathan Wakely <jwakely@redhat.com>
To: "Arsen Arsenović" <arsen@aarsen.me>
Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org
Subject: Re: [PATCH v2 1/2] libstdc++: Implement more maintainable <version> header
Date: Wed, 16 Aug 2023 12:15:39 +0100 [thread overview]
Message-ID: <CACb0b4k4d0HVvH2edpjx0xz2j4tJf-ZM_Tqb-Cy+VLPdXP6f5Q@mail.gmail.com> (raw)
In-Reply-To: <20230813195939.1099991-1-arsen@aarsen.me>
On Sun, 13 Aug 2023 at 21:15, Arsen Arsenović via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> This commit replaces the ad-hoc logic in <version> with an AutoGen
> database that (mostly) declaratively generates a version.h bit which
> combines all of the FTM logic across all headers together.
>
> This generated header defines macros of the form __glibcxx_foo,
> equivalent to their __cpp_lib_foo variants, according to rules specified
> in version.def and, optionally, if __glibcxx_want_foo or
> __glibcxx_want_all are defined, also defines __cpp_lib_foo forms with
> the same definition.
>
> libstdc++-v3/ChangeLog:
>
> * include/Makefile.am (bits_freestanding): Add version.h.
> (allcreated): Add version.h.
> (${bits_srcdir}/version.h): New rule. Regenerates
> version.h out of version.{def,tpl}.
> * include/Makefile.in: Regenerate.
> * include/bits/version.def: New file. Declares a list of
> all feature test macros, their values and their preconditions.
> * include/bits/version.tpl: New file. Turns version.def
> into a sequence of #if blocks.
> * include/bits/version.h: New file. Generated from
> version.def.
> * include/std/version: Replace with a __glibcxx_want_all define
> and bits/version.h include.
I still don't love this change, due to the added overhead in
preprocessing time. I also don't understand the Guile code in the
autogen template, but that's OK too.
But defining them all in one place, in a consistent form, is
definitely an improvement, so that the macros in <version> are always
consistent with other headers. And not having the definitions
scattered around various headers is probably much easier for most
maintainers to follow.
I think it's a net improvement, so OK for trunk. Thanks for working on this.
I wonder why we only define __cpp_lib_null_iterators for >= C++14. It
was a C++14 change, but in practice it Just Works even in C++98 mode.
We don't have any code pre-C++14 that makes it *not* work (except
debug mode). We should revisit that.
prev parent reply other threads:[~2023-08-16 11:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-13 19:35 Arsen Arsenović
2023-08-13 19:35 ` [PATCH v2 2/2] libstdc++: Replace all manual FTM definitions and use Arsen Arsenović
2023-08-16 11:15 ` Jonathan Wakely
2023-08-16 12:47 ` Arsen Arsenović
2023-08-14 15:18 ` [PATCH v2 1/2] libstdc++: Implement more maintainable <version> header Arsen Arsenović
2023-08-16 11:15 ` Jonathan Wakely [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=CACb0b4k4d0HVvH2edpjx0xz2j4tJf-ZM_Tqb-Cy+VLPdXP6f5Q@mail.gmail.com \
--to=jwakely@redhat.com \
--cc=arsen@aarsen.me \
--cc=gcc-patches@gcc.gnu.org \
--cc=libstdc++@gcc.gnu.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).