From 1c334db4c818eb4175e9e246f3fc5d91bcfe1eef Mon Sep 17 00:00:00 2001 From: George Peter Banyard Date: Wed, 5 Feb 2020 17:36:41 +0100 Subject: [PATCH] Add -Wextra compiler warnings and exclude the trigger happy ones The compile warnings which are explicitly suppressed are: * -Wno-implicit-fallthrough * -Wno-unused-parameter * -Wno-sign-compare * -Wno-clobbered, only with GCC Closes GH-5151 --- Zend/Zend.m4 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Zend/Zend.m4 b/Zend/Zend.m4 index fc4634580ec..7c715e853bf 100644 --- a/Zend/Zend.m4 +++ b/Zend/Zend.m4 @@ -221,7 +221,10 @@ else AC_DEFINE(ZEND_DEBUG,0,[ ]) fi -test -n "$GCC" && CFLAGS="$CFLAGS -Wall -Wno-strict-aliasing" +test -n "$GCC" && CFLAGS="$CFLAGS -Wall -Wextra -Wno-strict-aliasing -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-sign-compare" +dnl Check if compiler supports -Wno-clobbered (only GCC) +AX_CHECK_COMPILE_FLAG([-Wno-clobbered], CFLAGS="$CFLAGS -Wno-clobbered", , [-Werror]) + test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS" if test "$ZEND_ZTS" = "yes"; then