-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix: follow-up #6596 disable -Wno-stringop-overread for all compiler #6620
base: develop
Are you sure you want to change the base?
Conversation
…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); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
WalkthroughThe 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (6)
🪧 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 (
|
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 1e062a6
I can confirm the issue on gcc13.3. But it compiles fine via clang so let's maybe do this instead diff --git a/configure.ac b/configure.ac
index a1c1d71f7..1fd5d86b3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -460,12 +460,12 @@ if test "x$enable_werror" = "xyes"; then
dnl -Wstringop-overread is broken in GCC 11.
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]],
- [[#if __GNUC__ == 11
- #error -Wstringop-overread is broken in GCC 11
+ [[#if defined(__GNUC__)
+ #error -Wstringop-overflow and -Wstringop-overread are broken in GCC
#endif
]])],
[],
- [ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Wno-stringop-overread"])
+ [ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Wno-stringop-overflow -Wno-stringop-overread"])
fi
if test "x$CXXFLAGS_overridden" = "xno"; then |
Hmm... looks like my suggestion was incomplete. Let's add 45b21df. |
hm, I just realized that clang doesn't have
I'd prefer to come back to 1e062a6 because it validates if compiler has or doesn't have this feature. @UdjinM6 any objections? |
yeah, makes sense |
nvm |
sorry for confusion 🙈 pls switch back to 1e062a6 |
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 1e062a6
Issue being fixed or feature implemented
When compiling with -O3 and gcc 14 I got these compilation errors (multiple places):
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: