public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org
Subject: [committed] libstdc++: Fix build for targets without _Float128 [PR109921]
Date: Wed, 31 May 2023 21:05:32 +0100	[thread overview]
Message-ID: <20230531200532.6935-1-jwakely@redhat.com> (raw)
In-Reply-To: <20230531122222.4116868-1-jwakely@redhat.com>

Tested x86_64-linux. Built msp430-elf and cris-elf. Pushed to trunk.

-- >8 --

My r14-1431-g7037e7b6e4ac41 change caused the _Float128 overload to be
compiled unconditionally, by moving the USE_STRTOF128_FOR_FROM_CHARS
check into the function body. That function should still only be
compiled if the target actually supports _Float128.

libstdc++-v3/ChangeLog:

	PR libstdc++/109921
	* src/c++17/floating_from_chars.cc: Check __FLT128_MANT_DIG__ is
	defined before trying to use _Float128.
---
 libstdc++-v3/src/c++17/floating_from_chars.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libstdc++-v3/src/c++17/floating_from_chars.cc b/libstdc++-v3/src/c++17/floating_from_chars.cc
index eea878072b0..f1dd1037bf3 100644
--- a/libstdc++-v3/src/c++17/floating_from_chars.cc
+++ b/libstdc++-v3/src/c++17/floating_from_chars.cc
@@ -1325,7 +1325,7 @@ _ZSt10from_charsPKcS0_RDF128_St12chars_format(const char* first,
 					      __ieee128& value,
 					      chars_format fmt) noexcept
 __attribute__((alias ("_ZSt10from_charsPKcS0_Ru9__ieee128St12chars_format")));
-#else
+#elif defined(__FLT128_MANT_DIG__)
 from_chars_result
 from_chars(const char* first, const char* last, _Float128& value,
 	   chars_format fmt) noexcept
-- 
2.40.1


  parent reply	other threads:[~2023-05-31 20:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31 12:22 [committed] libstdc++: Fix preprocessor conditions for std::from_chars [PR109921] Jonathan Wakely
2023-05-31 20:02 ` [committed] libstdc++: Fix configure test for 32-bit targets Jonathan Wakely
2023-05-31 20:05 ` Jonathan Wakely [this message]
2023-06-01  9:29 ` [committed] libstdc++: Fix preprocessor conditions for std::from_chars [PR109921] Christophe Lyon
2023-06-01 11:05   ` Jonathan Wakely
2023-06-29 12:49     ` Jonathan Wakely
2023-06-29 13:25       ` Christophe Lyon

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=20230531200532.6935-1-jwakely@redhat.com \
    --to=jwakely@redhat.com \
    --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).