Bug 1349638

Summary: boost.multiprecision does not compile
Product: [Fedora] Fedora Reporter: Avi Kivity <avi.kivity>
Component: boostAssignee: Jonathan Wakely <jwakely>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: asias.hejun, dakingun, denis.arnaud_fedora, jwakely, me
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: boost-1.60.0-6.fc24 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-02 15:25:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Avi Kivity 2016-06-23 20:25:44 UTC
Description of problem:

Compiler errors (well, I use -Werror) when compiling an application that uses boost.multiprecision.


Version-Release number of selected component (if applicable):
boost-1.60.0-5.fc24.x86_64

How reproducible:


Steps to Reproduce:
1. Compile anything that uses boost.multiprecision (like https://github.com/scylladb/scylla)
2. Watch it break.


Actual results:

/usr/include/boost/multiprecision/cpp_int.hpp:193:46: error: right operand of shift expression ‘(1u << 63u)’ is >= than the precision of the left operand [-fpermissive]
    BOOST_STATIC_CONSTANT(limb_type, sign_bit_mask = 1u << (limb_bits - 1));
                                           ~~~^~~~~~~~~~~~~~~~~~
/usr/include/boost/multiprecision/cpp_int.hpp:416:46: error: right operand of shift expression ‘(1u << 63u)’ is >= than the precision of the left operand [-fpermissive]
    BOOST_STATIC_CONSTANT(limb_type, sign_bit_mask = 1u << (limb_bits - 1));
                                           ~~~^~~~~~~~~~~~~~~~~~
/usr/include/boost/multiprecision/cpp_int.hpp:568:46: error: right operand of shift expression ‘(1u << 63u)’ is >= than the precision of the left operand [-fpermissive]
    BOOST_STATIC_CONSTANT(limb_type, sign_bit_mask = 1u << (limb_bits - 1));
                                           ~~~^~~~~~~~~~~~~~~~~~



Expected results:

Clean compile.


Additional info:

Can be trivially fixed by casting 1u to limb_type.

Comment 1 Avi Kivity 2016-06-27 18:17:50 UTC
I can post a patch, if it helps.

Comment 2 Avi Kivity 2016-06-27 18:21:17 UTC
Alternatively, f9c8f9ec091ad232c0a291904f7839d665d098e0 from the boost/libs/multiprecision submodule fixes the problem.

Comment 3 Asias He 2016-06-28 06:23:22 UTC
I can confirm

https://github.com/boostorg/multiprecision/commit/f9c8f9ec091ad232c0a291904f7839d665d098e0

fixes the problem.

Comment 4 Jonathan Wakely 2016-06-28 10:10:09 UTC
(In reply to Asias He from comment #3)
> I can confirm
> 
> https://github.com/boostorg/multiprecision/commit/
> f9c8f9ec091ad232c0a291904f7839d665d098e0
> 
> fixes the problem.

I'll backport that, thanks.

Comment 5 Jonathan Wakely 2016-06-28 18:28:27 UTC
Fixed in rawhide, f24 to follow ...

Comment 6 Jonathan Wakely 2016-06-28 22:16:07 UTC
There's a new build for f24 at http://koji.fedoraproject.org/koji/buildinfo?buildID=776354 but I don't think it can be pushed to updates-testing at this point.

Comment 7 Avi Kivity 2016-06-29 05:29:11 UTC
Installed boost-devel from that build; it fixes my problem.  Thanks a lot.

Comment 8 Fedora Update System 2016-06-29 08:41:54 UTC
boost-1.60.0-6.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-0474072244

Comment 9 Fedora Update System 2016-06-29 22:55:37 UTC
boost-1.60.0-6.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-0474072244

Comment 10 Fedora Update System 2016-07-02 15:25:03 UTC
boost-1.60.0-6.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.