mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #13145 from ethereum/fixCompilationError
Fix GCC compilation errors due to Boost 1.79 update
This commit is contained in:
commit
9542e46ea4
@ -184,7 +184,7 @@ GasMeter::GasConsumption GasMeter::estimateMax(AssemblyItem const& _item, bool _
|
||||
if (*value)
|
||||
{
|
||||
// Note: msb() counts from 0 and throws on 0 as input.
|
||||
unsigned const significantByteCount = (boost::multiprecision::msb(*value) + 1 + 7) / 8;
|
||||
unsigned const significantByteCount = (static_cast<unsigned>(boost::multiprecision::msb(*value)) + 1u + 7u) / 8u;
|
||||
gas += GasCosts::expByteGas(m_evmVersion) * significantByteCount;
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ bool fitsPrecisionExp(bigint const& _base, bigint const& _exp)
|
||||
|
||||
size_t const bitsMax = 4096;
|
||||
|
||||
unsigned mostSignificantBaseBit = boost::multiprecision::msb(_base);
|
||||
size_t mostSignificantBaseBit = static_cast<size_t>(boost::multiprecision::msb(_base));
|
||||
if (mostSignificantBaseBit == 0) // _base == 1
|
||||
return true;
|
||||
if (mostSignificantBaseBit > bitsMax) // _base >= 2 ^ 4096
|
||||
|
@ -31,7 +31,7 @@ bool solidity::fitsPrecisionBaseX(bigint const& _mantissa, double _log2OfBase, u
|
||||
|
||||
size_t const bitsMax = 4096;
|
||||
|
||||
unsigned mostSignificantMantissaBit = boost::multiprecision::msb(_mantissa);
|
||||
size_t mostSignificantMantissaBit = static_cast<size_t>(boost::multiprecision::msb(_mantissa));
|
||||
if (mostSignificantMantissaBit > bitsMax) // _mantissa >= 2 ^ 4096
|
||||
return false;
|
||||
|
||||
|
@ -33,6 +33,9 @@
|
||||
#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overread"
|
||||
#pragma GCC diagnostic ignored "-Waggressive-loop-optimizations"
|
||||
#endif
|
||||
#include <boost/multiprecision/cpp_int.hpp>
|
||||
#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12)
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
#include <test/libsolidity/util/SoltestErrors.h>
|
||||
|
||||
#include <fstream>
|
||||
|
||||
using namespace std;
|
||||
using namespace solidity;
|
||||
using namespace solidity::test;
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/test/tools/output_test_stream.hpp>
|
||||
|
||||
#include <fstream>
|
||||
#include <regex>
|
||||
#include <sstream>
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
|
||||
using namespace std;
|
||||
using namespace solidity::test;
|
||||
|
Loading…
Reference in New Issue
Block a user