Skip to content

Commit e40a931

Browse files
Merge dashpay#6773: fix: hide multiple useless warnings for default build
eacd3df fmt: remove extra spaces in configure.ac (Konstantin Akimov) 82d73aa fix: hide multiple useless warnings for default build (Konstantin Akimov) Pull request description: ## Issue being fixed or feature implemented Default build produces hundreds of warnings. These warnings are disabled for `--enable-werror`, but they all are show for regular builds. In file included from ./hash.h:16, from ./bls/bls.h:8, from ./evo/dmnstate.h:8, from ./evo/deterministicmns.h:8, from evo/deterministicmns.cpp:5: 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 CheckProUpServTx(CDeterministicMNManager&, const CTransaction&, gsl::not_null<const CBlockIndex*>, TxValidationState&, bool)’ at evo/deterministicmns.cpp:1158:101: ./uint256.h:55:77: warning: ‘int __builtin_memcmp_eq(const void*, const void*, long unsigned int)’ specified bound 32 exceeds source size 0 [-Wstringop-overread] 55 | constexpr int Compare(const base_blob& other) const { return std::memcmp(m_data.data(), other.m_data.data(), WIDTH); } ## What was done? Hide useless warnings for default build too. They have no use. ## How Has This Been Tested? Configure with --enable-werror and without it: ``` ./configure --prefix=$(pwd)/depends/x86_64-pc-linux-gnu --enable-werror --enable-debug --enable-stacktraces --enable-crash-hooks --enable-maintainer-mode ./configure --prefix=$(pwd)/depends/x86_64-pc-linux-gnu ``` Works fine now! ## Breaking Changes N/A ## Checklist: - [x] I have performed a self-review of my own code - [ ] 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 ACKs for top commit: UdjinM6: utACK eacd3df Tree-SHA512: 563d5666db19d7af0b8ad9fc5957f49b63b0fcc6febcead3526aead72db6e4b62ba99a750d82eed9572f50005f519fc2006a911bf9975dd64b73d928cb030fa9
2 parents 86071f9 + eacd3df commit e40a931

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

configure.ac

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -450,15 +450,6 @@ if test "$enable_werror" = "yes"; then
450450
fi
451451
ERROR_CXXFLAGS=$CXXFLAG_WERROR
452452

453-
dnl -Warray-bounds cause problems with GCC. Do not treat these warnings as errors.
454-
dnl Suppress -Warray-bounds entirely because of noisy output, currently unhappy with immer implementation.
455-
AX_CHECK_COMPILE_FLAG([-Warray-bounds], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-array-bounds"], [], [$CXXFLAG_WERROR], [AC_LANG_SOURCE([
456-
#if defined(__clang__) || defined(__INTEL_COMPILER) || !defined(__GNUC__)
457-
#error Non-GCC compiler detected, not setting flag
458-
#endif
459-
int main(void) { return 0; }
460-
])])
461-
462453
dnl -Wattributes cause problems with some versions of GCC. Do not treat these warnings as errors.
463454
AX_CHECK_COMPILE_FLAG([-Wattributes], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-error=attributes"], [], [$CXXFLAG_WERROR], [AC_LANG_SOURCE([
464455
#if defined(__clang__) || defined(__INTEL_COMPILER) || !defined(__GNUC__)
@@ -478,22 +469,31 @@ if test "$enable_werror" = "yes"; then
478469
#endif
479470
int main(void) { return 0; }
480471
])])
481-
482-
dnl -Wstringop-overread and -Wstringop-overflow are broken in GCC. Suppress warnings entirely to avoid noisy output.
483-
AX_CHECK_COMPILE_FLAG([-Wstringop-overread], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-stringop-overread"], [], [$CXXFLAG_WERROR], [AC_LANG_SOURCE([
484-
#if defined(__clang__) || defined(__INTEL_COMPILER) || !defined(__GNUC__)
485-
#error Non-GCC compiler detected, not setting flag
486-
#endif
487-
int main(void) { return 0; }
488-
])])
489-
AX_CHECK_COMPILE_FLAG([-Wstringop-overflow], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-stringop-overflow"], [], [$CXXFLAG_WERROR], [AC_LANG_SOURCE([
490-
#if defined(__clang__) || defined(__INTEL_COMPILER) || !defined(__GNUC__)
491-
#error Non-GCC compiler detected, not setting flag
492-
#endif
493-
int main(void) { return 0; }
494-
])])
495472
fi
496473

474+
dnl -Warray-bounds cause problems with GCC. Do not treat these warnings as errors.
475+
dnl Suppress -Warray-bounds entirely because of noisy output, currently unhappy with immer implementation.
476+
AX_CHECK_COMPILE_FLAG([-Warray-bounds], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-array-bounds"], [], [$CXXFLAG_WERROR], [AC_LANG_SOURCE([
477+
#if defined(__clang__) || defined(__INTEL_COMPILER) || !defined(__GNUC__)
478+
#error Non-GCC compiler detected, not setting flag
479+
#endif
480+
int main(void) { return 0; }
481+
])])
482+
483+
dnl -Wstringop-overread and -Wstringop-overflow are broken in GCC. Suppress warnings entirely to avoid noisy output.
484+
AX_CHECK_COMPILE_FLAG([-Wstringop-overread], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-stringop-overread"], [], [$CXXFLAG_WERROR], [AC_LANG_SOURCE([
485+
#if defined(__clang__) || defined(__INTEL_COMPILER) || !defined(__GNUC__)
486+
#error Non-GCC compiler detected, not setting flag
487+
#endif
488+
int main(void) { return 0; }
489+
])])
490+
AX_CHECK_COMPILE_FLAG([-Wstringop-overflow], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-stringop-overflow"], [], [$CXXFLAG_WERROR], [AC_LANG_SOURCE([
491+
#if defined(__clang__) || defined(__INTEL_COMPILER) || !defined(__GNUC__)
492+
#error Non-GCC compiler detected, not setting flag
493+
#endif
494+
int main(void) { return 0; }
495+
])])
496+
497497
AX_CHECK_COMPILE_FLAG([-Wall], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wall"], [], [$CXXFLAG_WERROR])
498498
AX_CHECK_COMPILE_FLAG([-Wextra], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wextra"], [], [$CXXFLAG_WERROR])
499499
AX_CHECK_COMPILE_FLAG([-Wgnu], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wgnu"], [], [$CXXFLAG_WERROR])

0 commit comments

Comments
 (0)