public inbox for
 help / color / mirror / Atom feed
From: Jonathan Wakely <>
To: Patrick Palka <>
Cc: Jonathan Wakely <>,
	"libstdc++" <>,
	 gcc-patches <>
Subject: Re: [PATCH] libstdc++: Ensure that std::from_chars is declared when supported
Date: Mon, 14 Mar 2022 21:15:34 +0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <d3a7cc04-b15a-0829-f2df-7935a2513818@idea>

On Mon, 14 Mar 2022 at 14:17, Patrick Palka via Libstdc++
<> wrote:
> On Fri, 11 Mar 2022, Jonathan Wakely wrote:
> > Patrick, I think this is right, but please take a look to double check.
> >
> > I think we should fix the feature-test macro conditions for gcc-11 too,
> > although it's a bit more complicated there. It should depend on IEEE
> > float and double *and* uselocale. We don't need the other changes on the
> > branch.
> Don't we still depend on uselocale in GCC 12 for long double from_chars,
> at least on targets where long double != binary64?

Not after this patch:

from_chars(const char* first, const char* last, long double& value,
          chars_format fmt) noexcept
+  // Either long double is the same as double, or we can't use strtold.
+  // In the latter case, this might give an incorrect result (e.g. values
+  // out of range of double give an error, even if they fit in long double).

If uselocale isn't available, this defines the long double overload in
terms of the double one, even if that doesn't always give the right
answers. That greatly simplifies the preprocessor conditions for when
it's supported. If the float and double forms are present, so is the
long double one.

  reply	other threads:[~2022-03-14 21:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-11 18:32 Jonathan Wakely
2022-03-14 14:15 ` Patrick Palka
2022-03-14 21:15   ` Jonathan Wakely [this message]
2022-03-15 14:12     ` Patrick Palka
2022-03-16 16:26       ` Jonathan Wakely
2022-03-16 16:54   ` Jonathan Wakely

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:

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

  git send-email \
    --in-reply-to='' \ \ \ \ \ \

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