]> granicus.if.org Git - php/commitdiff
Add -Wextra compiler warnings and exclude the trigger happy ones
authorGeorge Peter Banyard <girgias@php.net>
Wed, 5 Feb 2020 16:36:41 +0000 (17:36 +0100)
committerGeorge Peter Banyard <girgias@php.net>
Tue, 14 Apr 2020 20:22:35 +0000 (22:22 +0200)
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

index fc4634580eceeccbbc5841c7772822c8f91c4a7a..7c715e853bf5be1ddb4aaa3386e12fc05e605e69 100644 (file)
@@ -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