Skip to content

Commit 9542e46

Browse files
authored
Merge pull request #13145 from ethereum/fixCompilationError
Fix GCC compilation errors due to Boost 1.79 update
2 parents b45bc39 + 53c4fac commit 9542e46

File tree

7 files changed

+10
-3
lines changed

7 files changed

+10
-3
lines changed

libevmasm/GasMeter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ GasMeter::GasConsumption GasMeter::estimateMax(AssemblyItem const& _item, bool _
184184
if (*value)
185185
{
186186
// Note: msb() counts from 0 and throws on 0 as input.
187-
unsigned const significantByteCount = (boost::multiprecision::msb(*value) + 1 + 7) / 8;
187+
unsigned const significantByteCount = (static_cast<unsigned>(boost::multiprecision::msb(*value)) + 1u + 7u) / 8u;
188188
gas += GasCosts::expByteGas(m_evmVersion) * significantByteCount;
189189
}
190190
}

libsolidity/analysis/ConstantEvaluator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ bool fitsPrecisionExp(bigint const& _base, bigint const& _exp)
4949

5050
size_t const bitsMax = 4096;
5151

52-
unsigned mostSignificantBaseBit = boost::multiprecision::msb(_base);
52+
size_t mostSignificantBaseBit = static_cast<size_t>(boost::multiprecision::msb(_base));
5353
if (mostSignificantBaseBit == 0) // _base == 1
5454
return true;
5555
if (mostSignificantBaseBit > bitsMax) // _base >= 2 ^ 4096

libsolutil/Numeric.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ bool solidity::fitsPrecisionBaseX(bigint const& _mantissa, double _log2OfBase, u
3131

3232
size_t const bitsMax = 4096;
3333

34-
unsigned mostSignificantMantissaBit = boost::multiprecision::msb(_mantissa);
34+
size_t mostSignificantMantissaBit = static_cast<size_t>(boost::multiprecision::msb(_mantissa));
3535
if (mostSignificantMantissaBit > bitsMax) // _mantissa >= 2 ^ 4096
3636
return false;
3737

libsolutil/Numeric.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12)
3434
#pragma GCC diagnostic push
3535
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
36+
#pragma GCC diagnostic ignored "-Warray-bounds"
37+
#pragma GCC diagnostic ignored "-Wstringop-overread"
38+
#pragma GCC diagnostic ignored "-Waggressive-loop-optimizations"
3639
#endif
3740
#include <boost/multiprecision/cpp_int.hpp>
3841
#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12)

test/FilesystemUtils.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
#include <test/libsolidity/util/SoltestErrors.h>
2222

23+
#include <fstream>
24+
2325
using namespace std;
2426
using namespace solidity;
2527
using namespace solidity::test;

test/yulPhaser/AlgorithmRunner.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <boost/test/unit_test.hpp>
3232
#include <boost/test/tools/output_test_stream.hpp>
3333

34+
#include <fstream>
3435
#include <regex>
3536
#include <sstream>
3637

test/yulPhaser/Phaser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <boost/test/unit_test.hpp>
3131

3232
#include <algorithm>
33+
#include <fstream>
3334

3435
using namespace std;
3536
using namespace solidity::test;

0 commit comments

Comments
 (0)