Skip to content

Commit 52edb6e

Browse files
fanquakejanus
authored andcommitted
ci: document that -Wreturn-type has been fixed upstream (Windows)
`noreturn` attributes have been added to the mingw-w64 headers, meaning that from 11.0.0 onwards, you'll no-longer see `-Wreturn-type` warnings when using assert(false): mingw-w64/mingw-w64@1690994. Add -Wno-return-type to the Windows CI, where is should have been all along, and document why it's required. This can be dropped when we are using the fixed version of the mingw-w64 headers there. Drop the -Werror -Wno-return-type special case from our build system. -Wreturn-type is on by default in Clang and GCC.
1 parent 2b9bf72 commit 52edb6e

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

ci/test/00_setup_env_win64.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,7 @@ export DPKG_ADD_ARCH="i386"
2020
export PACKAGES="nsis g++-mingw-w64-x86-64-posix wine-binfmt wine64 wine32 file"
2121
export RUN_FUNCTIONAL_TESTS=false
2222
export GOAL="deploy"
23-
export BGL_CONFIG="--enable-reduce-exports --enable-external-signer --disable-gui-tests"
23+
# Prior to 11.0.0, the mingw-w64 headers were missing noreturn attributes, causing warnings when
24+
# cross-compiling for Windows. https://sourceforge.net/p/mingw-w64/bugs/306/
25+
# https://github.com/mingw-w64/mingw-w64/commit/1690994f515910a31b9fb7c7bd3a52d4ba987abe
26+
export BGL_CONFIG="--enable-reduce-exports --enable-external-signer --disable-gui-tests CXXFLAGS=-Wno-return-type"

configure.ac

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -436,12 +436,6 @@ if test "$enable_werror" = "yes"; then
436436
AC_MSG_ERROR([enable-werror set but -Werror is not usable])
437437
fi
438438
ERROR_CXXFLAGS=$CXXFLAG_WERROR
439-
440-
dnl -Wreturn-type is broken in GCC for MinGW-w64.
441-
dnl https://sourceforge.net/p/mingw-w64/bugs/306/
442-
AX_CHECK_COMPILE_FLAG([-Werror=return-type], [], [ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Wno-error=return-type"], [$CXXFLAG_WERROR],
443-
[AC_LANG_SOURCE([[#include <cassert>
444-
int f(){ assert(false); }]])])
445439
fi
446440

447441
if test "$CXXFLAGS_overridden" = "no"; then

0 commit comments

Comments
 (0)