public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Patrick Palka <ppalka@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r11-6260] libstdc++: Fix build failure on AArch64 ILP32 [PR98370]
Date: Fri, 18 Dec 2020 16:55:26 +0000 (GMT)	[thread overview]
Message-ID: <20201218165526.780923898525@sourceware.org> (raw)

https://gcc.gnu.org/g:22a7e82c200d01d12e34e757e86dc9796a9bf085

commit r11-6260-g22a7e82c200d01d12e34e757e86dc9796a9bf085
Author: Patrick Palka <ppalka@redhat.com>
Date:   Fri Dec 18 11:52:24 2020 -0500

    libstdc++: Fix build failure on AArch64 ILP32 [PR98370]
    
    This should fix a build failure on AArch64 ILP32 due to int32_t mapping
    to long int instead of int on this platform, which causes type deduction
    to fail in the below call to std::max as reported in the PR.
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/98370
            * src/c++17/floating_to_chars.cc (__floating_to_chars_shortest):
            Provide explicit template arguments to the call to std::max.

Diff:
---
 libstdc++-v3/src/c++17/floating_to_chars.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libstdc++-v3/src/c++17/floating_to_chars.cc b/libstdc++-v3/src/c++17/floating_to_chars.cc
index 6470fbb0b95..3f46bce7a15 100644
--- a/libstdc++-v3/src/c++17/floating_to_chars.cc
+++ b/libstdc++-v3/src/c++17/floating_to_chars.cc
@@ -977,7 +977,7 @@ template<typename T>
 	// fd.exponent contain all of the information needed to format the
 	// number in fixed notation "as if by std::printf" (with precision
 	// equal to -fd.exponent).
-	const int whole_digits = max(mantissa_length + fd.exponent, 1);
+	const int whole_digits = max<int>(mantissa_length + fd.exponent, 1);
 	const int expected_output_length
 	  = fd.sign + whole_digits + strlen(".") + -fd.exponent;
 	if (last - first < expected_output_length)


                 reply	other threads:[~2020-12-18 16:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20201218165526.780923898525@sourceware.org \
    --to=ppalka@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@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).