]> granicus.if.org Git - php/commitdiff
Prepend compiler warning flags to CFLAG instead to append them
authorGeorge Peter Banyard <girgias@php.net>
Tue, 1 Sep 2020 10:17:58 +0000 (12:17 +0200)
committerGeorge Peter Banyard <girgias@php.net>
Tue, 1 Sep 2020 12:45:57 +0000 (14:45 +0200)
Credit to @bwoebi for the idea

Closes GH-6057

Zend/Zend.m4

index 76f9dd8810c74e7fbc64883f8d9c7dc0d7f023b3..3fdba96c97e70f43ffd09f8d9bf8b707a53b0986 100644 (file)
@@ -212,9 +212,9 @@ else
   AC_DEFINE(ZEND_DEBUG,0,[ ])
 fi
 
-test -n "$GCC" && CFLAGS="$CFLAGS -Wall -Wextra -Wno-strict-aliasing -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-sign-compare"
+test -n "$GCC" && CFLAGS="-Wall -Wextra -Wno-strict-aliasing -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-sign-compare $CFLAGS"
 dnl Check if compiler supports -Wno-clobbered (only GCC)
-AX_CHECK_COMPILE_FLAG([-Wno-clobbered], CFLAGS="$CFLAGS -Wno-clobbered", , [-Werror])
+AX_CHECK_COMPILE_FLAG([-Wno-clobbered], CFLAGS="-Wno-clobbered $CFLAGS", , [-Werror])
 
 test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"