Skip to content

Commit 750447e

Browse files
laanwjknst
authored andcommitted
Merge bitcoin#20586: Fix Windows build with --enable-werror
BACKPORT NOTE: Missing changes in src/fs.cpp are removed in bitcoin#20744 which is already backported b367745 ci: Make Cirrus CI Windows build with --enable-werror (Hennadii Stepanov) c713bb2 Fix Windows build with --enable-werror on Ubuntu Focal (Hennadii Stepanov) Pull request description: This PR makes possible to cross-compile Windows build with `--enable-werror --enable-suppress-external-warnings`. Some problems are fixed, others are silenced. Also `--enable-werror` is enabled for Cirrus CI Windows build (the last one on Cirrus CI without `--enable-werror`). ACKs for top commit: practicalswift: cr ACK b367745: patch looks correct laanwj: Code review ACK b367745 vasild: ACK b367745 jarolrod: ACK b367745 Tree-SHA512: 64f5c99b7dad4c0efce80cd45d7074f275bd8411235dc9e0841287bdab64b812c6f8f9d632c35531d0b8210148531f53aaaac77be7699b29d2d6aaae304dbee0
1 parent 368a6ef commit 750447e

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

ci/test/00_setup_env_win64.sh

-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,3 @@ export RUN_SECURITY_TESTS="false"
1515
export GOAL="deploy"
1616
export BITCOIN_CONFIG="--enable-gui --enable-reduce-exports --disable-miner --without-boost-process"
1717
export DIRECT_WINE_EXEC_TESTS=true
18-
19-
# Compiler for MinGW-w64 causes false -Wreturn-type warning.
20-
# See https://sourceforge.net/p/mingw-w64/bugs/306/
21-
export NO_WERROR=1

configure.ac

+7-1
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,13 @@ if test "x$enable_werror" = "xyes"; then
462462
AX_CHECK_COMPILE_FLAG([-Werror=range-loop-analysis],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=range-loop-analysis"],,[[$CXXFLAG_WERROR]])
463463
AX_CHECK_COMPILE_FLAG([-Werror=unused-variable],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=unused-variable"],,[[$CXXFLAG_WERROR]])
464464
AX_CHECK_COMPILE_FLAG([-Werror=date-time],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=date-time"],,[[$CXXFLAG_WERROR]])
465-
AX_CHECK_COMPILE_FLAG([-Werror=return-type],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=return-type"],,[[$CXXFLAG_WERROR]])
465+
466+
dnl -Wreturn-type is broken in GCC for MinGW-w64.
467+
dnl https://sourceforge.net/p/mingw-w64/bugs/306/
468+
AX_CHECK_COMPILE_FLAG([-Werror=return-type], [ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=return-type"], [], [$CXXFLAG_WERROR],
469+
[AC_LANG_SOURCE([[#include <cassert>
470+
int f(){ assert(false); }]])])
471+
466472
AX_CHECK_COMPILE_FLAG([-Werror=conditional-uninitialized],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=conditional-uninitialized"],,[[$CXXFLAG_WERROR]])
467473
AX_CHECK_COMPILE_FLAG([-Werror=sign-compare],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=sign-compare"],,[[$CXXFLAG_WERROR]])
468474
dnl -Wsuggest-override is broken with GCC before 9.2

src/qt/winshutdownmonitor.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class WinShutdownMonitor : public QAbstractNativeEventFilter
1717
{
1818
public:
1919
/** Implements QAbstractNativeEventFilter interface for processing Windows messages */
20-
bool nativeEventFilter(const QByteArray &eventType, void *pMessage, long *pnResult);
20+
bool nativeEventFilter(const QByteArray &eventType, void *pMessage, long *pnResult) override;
2121

2222
/** Register the reason for blocking shutdown on Windows to allow clean client exit */
2323
static void registerShutdownBlockReason(const QString& strReason, const HWND& mainWinId);

0 commit comments

Comments
 (0)