-
Notifications
You must be signed in to change notification settings - Fork 1.2k
backport: Merge bitcoin/bitcoin#23149: build: make --enable-werror just -Werror #6596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
38fd709 build: make --enable-werror just -Werror (fanquake) Pull request description: No longer special case a set of warnings, to make up our own -Werror, just use -Werror outright. This shouldn't really have any effect on existing builders, who were already using `--enable-werror`, and is more inline with what they would expect `--enable-werror` to be, which is erroring on any/all warnings. We keep `-Wno-error=return-type` because we know that is broken when using mingw-w64. It should only be applied when cross-compiling for Windows. Similar to the change in bitcoin#20544, but with (hopefully) less work-arounds, and other bundled changes. A step towards some configure "cleanups". ACKs for top commit: hebasto: ACK 38fd709 (also see bitcoin#23149 (comment)), tested: MarcoFalke: Concept ACK 38fd709 Tree-SHA512: 37f1857d9408442cab63e40f9280427b73e09cdf03146b19c1339d7e44abd78e93df7f270ca1da0e83b79343cd3ea915f7b9e4e347488b5bc5ceaaa7540e5926
WalkthroughThis pull request introduces two main types of changes. First, in the build configuration ( Second, across several Qt source files, the lambda expressions used in signal-slot connections have been updated. The capture mode in these lambda functions has been changed from capturing all variables by value ( 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Looks like gcc11 can't handle this. Bumping to gcc12 c0719a8 fixes the issue https://github.com/UdjinM6/dash/actions/runs/13493387032. Not sure if we need to do some other backports first though. @kwvg pls chime in. |
I'd prefer to keep gcc 11 in CI so we know that our code is buildable with that "minimum" supported version and still officially support gcc 11 awhile. I'd prepare other fix soon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/uint256.h (1)
55-57: Enhance the TODO comment to better document the rationale.The TODO comment could be improved to:
- Reference the specific GCC-11 bug/issue if available
- Document when this workaround can be removed (e.g., "Can be removed once minimum GCC version is >= 12")
- Explain why the cast is safe in this context
- // TODO: remove this gcc-11 workaround for memcmp - // gcc-11 can not recognise size of internal data in std::array even if width is not zero and show this warning: - // error: 'int __builtin_memcmp_eq(const void*, const void*, long unsigned int)' specified bound 32 exceeds source size 0 [-Werror=stringop-overread] + // TODO: Remove this GCC-11 workaround once minimum GCC version is >= 12 + // GCC-11 cannot recognize the size of internal data in std::array, resulting in: + // error: 'int __builtin_memcmp_eq(const void*, const void*, long unsigned int)' + // specified bound 32 exceeds source size 0 [-Werror=stringop-overread] + // The cast to const void* is safe here as WIDTH is statically verified to match m_data's size
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/uint256.h(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: x86_64-apple-darwin / Build depends
- GitHub Check: x86_64-w64-mingw32 / Build depends
- GitHub Check: x86_64-pc-linux-gnu_nowallet / Build depends
- GitHub Check: arm-linux-gnueabihf / Build depends
- GitHub Check: x86_64-pc-linux-gnu / Build depends
- GitHub Check: x86_64-pc-linux-gnu_multiprocess / Build depends
🔇 Additional comments (1)
src/uint256.h (1)
55-58: LGTM! The workaround effectively addresses the GCC-11 warning.The explicit casting of data pointers to
const void*is a safe solution that maintains the original functionality while avoiding the compiler warning.
My 22.04 machine (gcc11) built 8b8e73c 👍 |
|
@UdjinM6, diffing upstream and our Weird that this workaround is needed since Bitcoin maintains that Edit: Bitcoin Core v28.1 successfully builds with GCC 11.4, seems like we're missing something in terms of build configuration. Build parameters:
|
|
CI still fails even with the workaround applied btw... |
|
Let's maybe simply disable this flag for gcc11? We know it's broken and other versions should catch real issues so it should be safe to do this imo. Pls see 0b2c65f. GH: https://github.com/UdjinM6/dash/actions/runs/13519591113 |
This workaround let enable -Werror -Wall on our CI, otherwise compilation of uint256.h fails with this error:
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 errors
UdjinM6
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 2c4f77b
kwvg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 2c4f77b
PastaPastaPasta
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
built locally; looks good
…r all compiler
When compiling with -O3 and gcc 14 I got these compilation errors (multiple places):
In file included from /usr/include/c++/14/algorithm:60,
from ./test/fuzz/FuzzedDataProvider.h:16,
from test/fuzz/crypto_common.cpp:6:
In function ‘constexpr typename __gnu_cxx::__enable_if<std::__is_byte<_Tp>::__value, void>::__type std::__fill_a1(_Tp*, _Tp*, const _Tp&) [with _Tp = unsigned char]’,
inlined from ‘constexpr void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = unsigned char*; _Tp = unsigned char]’ at /usr/include/c++/14/bits/stl_algobase.h:998:21,
inlined from ‘constexpr _OutputIterator std::__fill_n_a(_OutputIterator, _Size, const _Tp&, random_access_iterator_tag) [with _OutputIterator = unsigned char*; _Size = long unsigned int; _Tp = unsigned char]’ at /usr/include/c++/14/bits/stl_algobase.h:1151:20,
inlined from ‘constexpr _OI std::fill_n(_OI, _Size, const _Tp&) [with _OI = unsigned char*; _Size = long unsigned int; _Tp = unsigned char]’ at /usr/include/c++/14/bits/stl_algobase.h:1180:29,
inlined from ‘static constexpr _ForwardIterator std::__uninitialized_default_n_1<true>::__uninit_default_n(_ForwardIterator, _Size) [with _ForwardIterator = unsigned char*; _Size = long unsigned int]’ at /usr/include/c++/14/bits/stl_uninitialized.h:668:29,
inlined from ‘static constexpr _ForwardIterator std::__uninitialized_default_n_1<true>::__uninit_default_n(_ForwardIterator, _Size) [with _ForwardIterator = unsigned char*; _Size = long unsigned int]’ at /usr/include/c++/14/bits/stl_uninitialized.h:660:9,
inlined from ‘constexpr _ForwardIterator std::__uninitialized_default_n(_ForwardIterator, _Size) [with _ForwardIterator = unsigned char*; _Size = long unsigned int]’ at /usr/include/c++/14/bits/stl_uninitialized.h:712:20,
inlined from ‘constexpr _ForwardIterator std::__uninitialized_default_n_a(_ForwardIterator, _Size, allocator<_Tp>&) [with _ForwardIterator = unsigned char*; _Size = long unsigned int; _Tp = unsigned char]’ at /usr/include/c++/14/bits/stl_uninitialized.h:779:44,
inlined from ‘constexpr void std::vector<_Tp, _Alloc>::_M_default_append(size_type) [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]’ at /usr/include/c++/14/bits/vector.tcc:863:35,
inlined from ‘constexpr void std::vector<_Tp, _Alloc>::resize(size_type) [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]’ at /usr/include/c++/14/bits/stl_vector.h:1016:21,
inlined from ‘std::vector<T> ConsumeFixedLengthByteVector(FuzzedDataProvider&, size_t) [with B = unsigned char]’ at ./test/fuzz/util.h:305:24,
inlined from ‘void crypto_common_fuzz_target(FuzzBufferType)’ at test/fuzz/crypto_common.cpp:22:101:
/usr/include/c++/14/bits/stl_algobase.h:972:25: error: ‘void* __builtin_memset(void*, int, long unsigned int)’ writing 1 byte into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
972 | __builtin_memset(__first, static_cast<unsigned char>(__tmp), __len);
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
…tringop-overflow
When compiling with -O3 and gcc 14 I got these compilation errors (multiple places):
In file included from /usr/include/c++/14/algorithm:60,
from ./test/fuzz/FuzzedDataProvider.h:16,
from test/fuzz/crypto_common.cpp:6:
In function ‘constexpr typename __gnu_cxx::__enable_if<std::__is_byte<_Tp>::__value, void>::__type std::__fill_a1(_Tp*, _Tp*, const _Tp&) [with _Tp = unsigned char]’,
inlined from ‘constexpr void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = unsigned char*; _Tp = unsigned char]’ at /usr/include/c++/14/bits/stl_algobase.h:998:21,
inlined from ‘constexpr _OutputIterator std::__fill_n_a(_OutputIterator, _Size, const _Tp&, random_access_iterator_tag) [with _OutputIterator = unsigned char*; _Size = long unsigned int; _Tp = unsigned char]’ at /usr/include/c++/14/bits/stl_algobase.h:1151:20,
inlined from ‘constexpr _OI std::fill_n(_OI, _Size, const _Tp&) [with _OI = unsigned char*; _Size = long unsigned int; _Tp = unsigned char]’ at /usr/include/c++/14/bits/stl_algobase.h:1180:29,
inlined from ‘static constexpr _ForwardIterator std::__uninitialized_default_n_1<true>::__uninit_default_n(_ForwardIterator, _Size) [with _ForwardIterator = unsigned char*; _Size = long unsigned int]’ at /usr/include/c++/14/bits/stl_uninitialized.h:668:29,
inlined from ‘static constexpr _ForwardIterator std::__uninitialized_default_n_1<true>::__uninit_default_n(_ForwardIterator, _Size) [with _ForwardIterator = unsigned char*; _Size = long unsigned int]’ at /usr/include/c++/14/bits/stl_uninitialized.h:660:9,
inlined from ‘constexpr _ForwardIterator std::__uninitialized_default_n(_ForwardIterator, _Size) [with _ForwardIterator = unsigned char*; _Size = long unsigned int]’ at /usr/include/c++/14/bits/stl_uninitialized.h:712:20,
inlined from ‘constexpr _ForwardIterator std::__uninitialized_default_n_a(_ForwardIterator, _Size, allocator<_Tp>&) [with _ForwardIterator = unsigned char*; _Size = long unsigned int; _Tp = unsigned char]’ at /usr/include/c++/14/bits/stl_uninitialized.h:779:44,
inlined from ‘constexpr void std::vector<_Tp, _Alloc>::_M_default_append(size_type) [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]’ at /usr/include/c++/14/bits/vector.tcc:863:35,
inlined from ‘constexpr void std::vector<_Tp, _Alloc>::resize(size_type) [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]’ at /usr/include/c++/14/bits/stl_vector.h:1016:21,
inlined from ‘std::vector<T> ConsumeFixedLengthByteVector(FuzzedDataProvider&, size_t) [with B = unsigned char]’ at ./test/fuzz/util.h:305:24,
inlined from ‘void crypto_common_fuzz_target(FuzzBufferType)’ at test/fuzz/crypto_common.cpp:22:101:
/usr/include/c++/14/bits/stl_algobase.h:972:25: error: ‘void* __builtin_memset(void*, int, long unsigned int)’ writing 1 byte into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
972 | __builtin_memset(__first, static_cast<unsigned char>(__tmp), __len);
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
…tringop-overflow
When compiling with -O3 and gcc 14 I got these compilation errors (multiple places):
In file included from /usr/include/c++/14/algorithm:60,
from ./test/fuzz/FuzzedDataProvider.h:16,
from test/fuzz/crypto_common.cpp:6:
In function ‘constexpr typename __gnu_cxx::__enable_if<std::__is_byte<_Tp>::__value, void>::__type std::__fill_a1(_Tp*, _Tp*, const _Tp&) [with _Tp = unsigned char]’,
inlined from ‘constexpr void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = unsigned char*; _Tp = unsigned char]’ at /usr/include/c++/14/bits/stl_algobase.h:998:21,
inlined from ‘constexpr _OutputIterator std::__fill_n_a(_OutputIterator, _Size, const _Tp&, random_access_iterator_tag) [with _OutputIterator = unsigned char*; _Size = long unsigned int; _Tp = unsigned char]’ at /usr/include/c++/14/bits/stl_algobase.h:1151:20,
inlined from ‘constexpr _OI std::fill_n(_OI, _Size, const _Tp&) [with _OI = unsigned char*; _Size = long unsigned int; _Tp = unsigned char]’ at /usr/include/c++/14/bits/stl_algobase.h:1180:29,
inlined from ‘static constexpr _ForwardIterator std::__uninitialized_default_n_1<true>::__uninit_default_n(_ForwardIterator, _Size) [with _ForwardIterator = unsigned char*; _Size = long unsigned int]’ at /usr/include/c++/14/bits/stl_uninitialized.h:668:29,
inlined from ‘static constexpr _ForwardIterator std::__uninitialized_default_n_1<true>::__uninit_default_n(_ForwardIterator, _Size) [with _ForwardIterator = unsigned char*; _Size = long unsigned int]’ at /usr/include/c++/14/bits/stl_uninitialized.h:660:9,
inlined from ‘constexpr _ForwardIterator std::__uninitialized_default_n(_ForwardIterator, _Size) [with _ForwardIterator = unsigned char*; _Size = long unsigned int]’ at /usr/include/c++/14/bits/stl_uninitialized.h:712:20,
inlined from ‘constexpr _ForwardIterator std::__uninitialized_default_n_a(_ForwardIterator, _Size, allocator<_Tp>&) [with _ForwardIterator = unsigned char*; _Size = long unsigned int; _Tp = unsigned char]’ at /usr/include/c++/14/bits/stl_uninitialized.h:779:44,
inlined from ‘constexpr void std::vector<_Tp, _Alloc>::_M_default_append(size_type) [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]’ at /usr/include/c++/14/bits/vector.tcc:863:35,
inlined from ‘constexpr void std::vector<_Tp, _Alloc>::resize(size_type) [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]’ at /usr/include/c++/14/bits/stl_vector.h:1016:21,
inlined from ‘std::vector<T> ConsumeFixedLengthByteVector(FuzzedDataProvider&, size_t) [with B = unsigned char]’ at ./test/fuzz/util.h:305:24,
inlined from ‘void crypto_common_fuzz_target(FuzzBufferType)’ at test/fuzz/crypto_common.cpp:22:101:
/usr/include/c++/14/bits/stl_algobase.h:972:25: error: ‘void* __builtin_memset(void*, int, long unsigned int)’ writing 1 byte into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
972 | __builtin_memset(__first, static_cast<unsigned char>(__tmp), __len);
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
…tringop-overflow
When compiling with -O3 and gcc 14 I got these compilation errors (multiple places):
In file included from /usr/include/c++/14/algorithm:60,
from ./test/fuzz/FuzzedDataProvider.h:16,
from test/fuzz/crypto_common.cpp:6:
In function ‘constexpr typename __gnu_cxx::__enable_if<std::__is_byte<_Tp>::__value, void>::__type std::__fill_a1(_Tp*, _Tp*, const _Tp&) [with _Tp = unsigned char]’,
inlined from ‘constexpr void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = unsigned char*; _Tp = unsigned char]’ at /usr/include/c++/14/bits/stl_algobase.h:998:21,
inlined from ‘constexpr _OutputIterator std::__fill_n_a(_OutputIterator, _Size, const _Tp&, random_access_iterator_tag) [with _OutputIterator = unsigned char*; _Size = long unsigned int; _Tp = unsigned char]’ at /usr/include/c++/14/bits/stl_algobase.h:1151:20,
inlined from ‘constexpr _OI std::fill_n(_OI, _Size, const _Tp&) [with _OI = unsigned char*; _Size = long unsigned int; _Tp = unsigned char]’ at /usr/include/c++/14/bits/stl_algobase.h:1180:29,
inlined from ‘static constexpr _ForwardIterator std::__uninitialized_default_n_1<true>::__uninit_default_n(_ForwardIterator, _Size) [with _ForwardIterator = unsigned char*; _Size = long unsigned int]’ at /usr/include/c++/14/bits/stl_uninitialized.h:668:29,
inlined from ‘static constexpr _ForwardIterator std::__uninitialized_default_n_1<true>::__uninit_default_n(_ForwardIterator, _Size) [with _ForwardIterator = unsigned char*; _Size = long unsigned int]’ at /usr/include/c++/14/bits/stl_uninitialized.h:660:9,
inlined from ‘constexpr _ForwardIterator std::__uninitialized_default_n(_ForwardIterator, _Size) [with _ForwardIterator = unsigned char*; _Size = long unsigned int]’ at /usr/include/c++/14/bits/stl_uninitialized.h:712:20,
inlined from ‘constexpr _ForwardIterator std::__uninitialized_default_n_a(_ForwardIterator, _Size, allocator<_Tp>&) [with _ForwardIterator = unsigned char*; _Size = long unsigned int; _Tp = unsigned char]’ at /usr/include/c++/14/bits/stl_uninitialized.h:779:44,
inlined from ‘constexpr void std::vector<_Tp, _Alloc>::_M_default_append(size_type) [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]’ at /usr/include/c++/14/bits/vector.tcc:863:35,
inlined from ‘constexpr void std::vector<_Tp, _Alloc>::resize(size_type) [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]’ at /usr/include/c++/14/bits/stl_vector.h:1016:21,
inlined from ‘std::vector<T> ConsumeFixedLengthByteVector(FuzzedDataProvider&, size_t) [with B = unsigned char]’ at ./test/fuzz/util.h:305:24,
inlined from ‘void crypto_common_fuzz_target(FuzzBufferType)’ at test/fuzz/crypto_common.cpp:22:101:
/usr/include/c++/14/bits/stl_algobase.h:972:25: error: ‘void* __builtin_memset(void*, int, long unsigned int)’ writing 1 byte into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
972 | __builtin_memset(__first, static_cast<unsigned char>(__tmp), __len);
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
…all compiler 1e062a6 fix: follow-up #6596 disable -Wno-stringop-overread and -Wno-stringop-overflow (Konstantin Akimov) Pull request description: ## Issue being fixed or feature implemented When compiling with -O3 and gcc 14 I got these compilation errors (multiple places): ``` $ CFLAGS="-O3" CXXFLAGS="-O3" ./configure --prefix=$(pwd)/depends/x86_64-pc-linux-gnu --enable-suppress-external-warnings --enable-debug --enable-stacktraces --enable-werror --enable-crash-hooks --enable-maintainer-mode $ make ... In file included from /usr/include/c++/14/algorithm:60, from ./test/fuzz/FuzzedDataProvider.h:16, from test/fuzz/crypto_common.cpp:6: In function ‘constexpr typename __gnu_cxx::__enable_if<std::__is_byte<_Tp>::__value, void>::__type std::__fill_a1(_Tp*, _Tp*, const _Tp&) [with _Tp = unsigned char]’, inlined from ‘constexpr void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = unsigned char*; _Tp = unsigned char]’ at /usr/include/c++/14/bits/stl_algobase.h:998:21, inlined from ‘constexpr _OutputIterator std::__fill_n_a(_OutputIterator, _Size, const _Tp&, random_access_iterator_tag) [with _OutputIterator = unsigned char*; _Size = long unsigned int; _Tp = unsigned char]’ at /usr/include/c++/14/bits/stl_algobase.h:1151:20, inlined from ‘constexpr _OI std::fill_n(_OI, _Size, const _Tp&) [with _OI = unsigned char*; _Size = long unsigned int; _Tp = unsigned char]’ at /usr/include/c++/14/bits/stl_algobase.h:1180:29, inlined from ‘static constexpr _ForwardIterator std::__uninitialized_default_n_1<true>::__uninit_default_n(_ForwardIterator, _Size) [with _ForwardIterator = unsigned char*; _Size = long unsigned int]’ at /usr/include/c++/14/bits/stl_uninitialized.h:668:29, inlined from ‘static constexpr _ForwardIterator std::__uninitialized_default_n_1<true>::__uninit_default_n(_ForwardIterator, _Size) [with _ForwardIterator = unsigned char*; _Size = long unsigned int]’ at /usr/include/c++/14/bits/stl_uninitialized.h:660:9, inlined from ‘constexpr _ForwardIterator std::__uninitialized_default_n(_ForwardIterator, _Size) [with _ForwardIterator = unsigned char*; _Size = long unsigned int]’ at /usr/include/c++/14/bits/stl_uninitialized.h:712:20, inlined from ‘constexpr _ForwardIterator std::__uninitialized_default_n_a(_ForwardIterator, _Size, allocator<_Tp>&) [with _ForwardIterator = unsigned char*; _Size = long unsigned int; _Tp = unsigned char]’ at /usr/include/c++/14/bits/stl_uninitialized.h:779:44, inlined from ‘constexpr void std::vector<_Tp, _Alloc>::_M_default_append(size_type) [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]’ at /usr/include/c++/14/bits/vector.tcc:863:35, inlined from ‘constexpr void std::vector<_Tp, _Alloc>::resize(size_type) [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]’ at /usr/include/c++/14/bits/stl_vector.h:1016:21, inlined from ‘std::vector<T> ConsumeFixedLengthByteVector(FuzzedDataProvider&, size_t) [with B = unsigned char]’ at ./test/fuzz/util.h:305:24, inlined from ‘void crypto_common_fuzz_target(FuzzBufferType)’ at test/fuzz/crypto_common.cpp:22:101: /usr/include/c++/14/bits/stl_algobase.h:972:25: error: ‘void* __builtin_memset(void*, int, long unsigned int)’ writing 1 byte into a region of size 0 overflows the destination [-Werror=stringop-overflow=] 972 | __builtin_memset(__first, static_cast<unsigned char>(__tmp), __len); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` ## What was done? Disabled stringop-overflow for all compilers (if supported), not only gcc 11. ## How Has This Been Tested? Local build succeed. ## Breaking Changes N/A ## Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: PastaPastaPasta: utACK 1e062a6 UdjinM6: ACK 1e062a6 PastaPastaPasta: utACK 1e062a6 Tree-SHA512: b7d84552d7c6961630e7c1c85f66df1919b202f58d7555b6d6e23080aa384110b3f5452d26ab3fc310daf25c40f31a3e4c62da09653e41f47b51f98ef3676937
What was done?
Backport bitcoin#23149 introduced more strict list of warnings that are considered as compilation error.
It caused several compilation errors, that has been addressed by this PR.
It has been split to own PR for easier testing / debugging from #6577
How Has This Been Tested?
It has been tested with clang 16.0.6 and gcc 13.2.0
No compilation errors.
Breaking Changes
N/A
Checklist: