From: George Peter Banyard Date: Tue, 1 Sep 2020 10:17:58 +0000 (+0200) Subject: Prepend compiler warning flags to CFLAG instead to append them X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5c1cf7669b937dcb4589cb0c8deccd343dfd85f9;p=php Prepend compiler warning flags to CFLAG instead to append them Credit to @bwoebi for the idea Closes GH-6057 --- diff --git a/Zend/Zend.m4 b/Zend/Zend.m4 index 76f9dd8810..3fdba96c97 100644 --- a/Zend/Zend.m4 +++ b/Zend/Zend.m4 @@ -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"