Merge pull request #13006 from ethereum/initializationOrderFix

Fix asorted compilation issues with GCC 12.
This commit is contained in:
Daniel Kirchner 2022-05-11 17:19:45 +02:00 committed by GitHub
commit 1d7b4704bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View File

@ -96,8 +96,8 @@ public:
void clear() { m_errorReporter.clear(); }
private:
ErrorReporter m_errorReporter;
ErrorList m_uniqueErrors;
ErrorReporter m_errorReporter;
std::map<std::pair<ErrorId, SourceLocation>, std::string> m_seenErrors;
};

View File

@ -29,7 +29,15 @@
#error "Unsupported Boost version. At least 1.65 required."
#endif
// TODO: do this only conditionally as soon as a boost version with gcc 12 support is released.
#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
#include <boost/multiprecision/cpp_int.hpp>
#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12)
#pragma GCC diagnostic pop
#endif
#include <limits>

View File

@ -94,7 +94,10 @@ public:
else if (value == 21)
return "true";
else
{
assertThrow(false, CBORException, "Unsupported simple value (not a boolean).");
return ""; // unreachable, but prevents compiler warning.
}
}
default:
assertThrow(false, CBORException, "Unsupported value type.");