Commit 57a1e73
committed
fix: gcc-11 workaround for memcmp in uint256 class
This workaround let enable -Werror -Wall on our CI
In member function ‘constexpr int base_blob<BITS>::Compare(const base_blob<BITS>&) const [with unsigned int BITS = 256]’,
inlined from ‘constexpr bool operator!=(const base_blob<256>&, const base_blob<256>&)’ at ./uint256.h:58:96,
inlined from ‘bool CDeterministicMNManager::BuildNewListFromBlock(const CBlock&, gsl::not_null<const CBlockIndex*>, BlockValidationState&, const CCoinsViewCache&, CDeterministicMNList&, llmq::CQuorumSnapshotManager&, bool)’ at evo/deterministicmns.cpp:818:119:
./uint256.h:55:77: error: ‘int __builtin_memcmp_eq(const void*, const void*, long unsigned int)’ specified bound 32 exceeds source size 0 [-Werror=stringop-overread]
55 | constexpr int Compare(const base_blob& other) const { return std::memcmp(m_data.data(), other.m_data.data(), WIDTH); }
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors1 parent 8af10d7 commit 57a1e73
1 file changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
56 | 68 | | |
57 | 69 | | |
58 | 70 | | |
| |||
0 commit comments