Add patch to fix narrowing conversions on ppc64le

https://github.com/boostorg/interval/issues/29
This commit is contained in:
Thomas Rodgers 2022-02-02 18:36:49 -08:00
parent 5eaac698fe
commit 9eaf760933
2 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,32 @@
From 0039878782516ea3313608f99f0d50e846151bc2 Mon Sep 17 00:00:00 2001
From: Jonathan Wakely <jwakely@fedoraproject.org>
Date: Mon, 31 Jan 2022 11:37:29 +0000
Subject: [PATCH] Fix narrowing conversions for ppc
These constants are too large for `long long` so are unsigned,
and then cannot be narrowed to the signed type.
Fixes #29
---
.../numeric/interval/detail/ppc_rounding_control.hpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/boost/numeric/interval/detail/ppc_rounding_control.hpp b/include/boost/numeric/interval/detail/ppc_rounding_control.hpp
index 87fe8ee..99f9986 100644
--- a/include/boost/numeric/interval/detail/ppc_rounding_control.hpp
+++ b/include/boost/numeric/interval/detail/ppc_rounding_control.hpp
@@ -28,10 +28,10 @@ typedef union {
double dmode;
} rounding_mode_struct;
-static const rounding_mode_struct mode_upward = { 0xFFF8000000000002LL };
-static const rounding_mode_struct mode_downward = { 0xFFF8000000000003LL };
-static const rounding_mode_struct mode_to_nearest = { 0xFFF8000000000000LL };
-static const rounding_mode_struct mode_toward_zero = { 0xFFF8000000000001LL };
+static const rounding_mode_struct mode_upward = { (::boost::long_long_type)0xFFF8000000000002LL };
+static const rounding_mode_struct mode_downward = { (::boost::long_long_type)0xFFF8000000000003LL };
+static const rounding_mode_struct mode_to_nearest = { (::boost::long_long_type)0xFFF8000000000000LL };
+static const rounding_mode_struct mode_toward_zero = { (::boost::long_long_type)0xFFF8000000000001LL };
struct ppc_rounding_control
{

View File

@ -42,7 +42,7 @@ Name: boost
%global real_name boost
Summary: The free peer-reviewed portable C++ source libraries
Version: 1.76.0
Release: 8%{?dist}
Release: 9%{?dist}
License: Boost and MIT and Python
# Replace each . with _ in %%{version}
@ -165,6 +165,11 @@ Patch102: boost-1.76.0-random-test.patch
# fixes ppc64le issue https://github.com/boostorg/multiprecision/issues/419
Patch103: boost-1.76.0-fix_multiprecision_issue_419-ppc64le.patch
# PR https://github.com/boostorg/interval/pull/30
# Fixes narrowing conversions for ppc -
# https://github.com/boostorg/interval/issues/29
Patch104: boost-1.76.0-fix-narrowing-conversions-for-ppc.patch
%bcond_with tests
%bcond_with docs_generated
@ -690,6 +695,7 @@ find ./boost -name '*.hpp' -perm /111 | xargs chmod a-x
%patch101 -p1
%patch102 -p1
%patch103 -p2
%patch104 -p2
%build
%set_build_flags
@ -1291,6 +1297,10 @@ fi
%{_mandir}/man1/b2.1*
%changelog
* Wed Feb 2 2022 Thomas Rodgers <trodgers@redhat.com> - 1.76.0-9
- Add patch to fix narrowing conversions on ppc64le
https://github.com/boostorg/interval/issues/29
* Tue Feb 1 2022 Laurent Rineau <laurent.rineau@cgal.org> - 1.76.0-8
- Add patch to fix Boost Multiprecision on ppc64le
https://github.com/boostorg/multiprecision/issues/419