diff --git a/libevmasm/GasMeter.cpp b/libevmasm/GasMeter.cpp index 3ad9ba084..d49ee9891 100644 --- a/libevmasm/GasMeter.cpp +++ b/libevmasm/GasMeter.cpp @@ -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(boost::multiprecision::msb(*value)) + 1u + 7u) / 8u; gas += GasCosts::expByteGas(m_evmVersion) * significantByteCount; } } diff --git a/libsolidity/analysis/ConstantEvaluator.cpp b/libsolidity/analysis/ConstantEvaluator.cpp index 0fc6761f7..7fde36ec0 100644 --- a/libsolidity/analysis/ConstantEvaluator.cpp +++ b/libsolidity/analysis/ConstantEvaluator.cpp @@ -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(boost::multiprecision::msb(_base)); if (mostSignificantBaseBit == 0) // _base == 1 return true; if (mostSignificantBaseBit > bitsMax) // _base >= 2 ^ 4096 diff --git a/libsolutil/Numeric.cpp b/libsolutil/Numeric.cpp index f1d4057e0..97a7b0420 100644 --- a/libsolutil/Numeric.cpp +++ b/libsolutil/Numeric.cpp @@ -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(boost::multiprecision::msb(_mantissa)); if (mostSignificantMantissaBit > bitsMax) // _mantissa >= 2 ^ 4096 return false; diff --git a/libsolutil/Numeric.h b/libsolutil/Numeric.h index 384589764..c0f33e490 100644 --- a/libsolutil/Numeric.h +++ b/libsolutil/Numeric.h @@ -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 #if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12) diff --git a/test/FilesystemUtils.cpp b/test/FilesystemUtils.cpp index 0d1de3af9..7506d677e 100644 --- a/test/FilesystemUtils.cpp +++ b/test/FilesystemUtils.cpp @@ -20,6 +20,8 @@ #include +#include + using namespace std; using namespace solidity; using namespace solidity::test; diff --git a/test/yulPhaser/AlgorithmRunner.cpp b/test/yulPhaser/AlgorithmRunner.cpp index c0c1aabd2..c8a9f40e6 100644 --- a/test/yulPhaser/AlgorithmRunner.cpp +++ b/test/yulPhaser/AlgorithmRunner.cpp @@ -31,6 +31,7 @@ #include #include +#include #include #include diff --git a/test/yulPhaser/Phaser.cpp b/test/yulPhaser/Phaser.cpp index d5d5dac59..60e980522 100644 --- a/test/yulPhaser/Phaser.cpp +++ b/test/yulPhaser/Phaser.cpp @@ -30,6 +30,7 @@ #include #include +#include using namespace std; using namespace solidity::test;