From: Arnaud Le Blanc Date: Tue, 19 May 2009 11:40:05 +0000 (+0000) Subject: Add GCC warnings in debug cflags for things likely to break VC builds X-Git-Tag: php-5.4.0alpha1~191^2~3606 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7f1b7479033dedc37404edc5fcd3524e0981adcd;p=php Add GCC warnings in debug cflags for things likely to break VC builds (-Wpointer-arith -Wdeclaration-after-statement) --- diff --git a/Zend/Zend.m4 b/Zend/Zend.m4 index df5436b992..a5bc223457 100644 --- a/Zend/Zend.m4 +++ b/Zend/Zend.m4 @@ -187,9 +187,20 @@ if test "$ZEND_DEBUG" = "yes"; then if test "$CFLAGS" = "-g -O2"; then CFLAGS=-g fi - test -n "$GCC" && DEBUG_CFLAGS="$DEBUG_CFLAGS -Wall" - test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "yes" && \ - DEBUG_CFLAGS="$DEBUG_CFLAGS -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations" + changequote({,}) + if test -n "$GCC"; then + + DEBUG_CFLAGS="$DEBUG_CFLAGS -Wall" + + "$CC" --help=warnings|grep -q -- '-Wpointer-arith[ \t]' && \ + DEBUG_CFLAGS="$DEBUG_CFLAGS -Wpointer-arith" + "$CC" --help=warnings|grep -q -- '-Wdeclaration-after-statement[ \t]' && \ + DEBUG_CFLAGS="$DEBUG_CFLAGS -Wdeclaration-after-statement" + + test "$USE_MAINTAINER_MODE" = "yes" && \ + DEBUG_CFLAGS="$DEBUG_CFLAGS -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations" + fi + changequote([,]) else AC_DEFINE(ZEND_DEBUG,0,[ ]) fi