Opened 6 years ago

Closed 6 years ago

#12181 closed Bugs (fixed)

Compile cpp_int fails in gcc6.1

Reported by: Mario Lezcano <mariolez@…> Owned by: John Maddock
Milestone: To Be Determined Component: multiprecision
Version: Boost 1.60.0 Severity: Problem
Keywords: Cc:

Description

Using boost 1.60.0-4 and gcc 6.1.1.20160501, the following code

// gcc6.cpp
#include <boost/multiprecision/cpp_int.hpp>

int main(){
}

fails to compile with error

In file included from /usr/include/boost/config.hpp:61:0,
                 from /usr/include/boost/cstdint.hpp:36,
                 from /usr/include/boost/multiprecision/cpp_int.hpp:11,
                 from gcc6.cpp:1:
/usr/include/boost/multiprecision/cpp_int.hpp:193:4: 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:4: 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:4: 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));

when compiled with

g++ gcc6.cpp

Change History (1)

comment:1 by John Maddock, 6 years ago

Resolution: fixed
Status: newclosed

This was fixed in https://github.com/boostorg/multiprecision/commit/f9c8f9ec091ad232c0a291904f7839d665d098e0 which will be in the next release (very shortly I hope!)

Note: See TracTickets for help on using tickets.