]> granicus.if.org Git - php/commitdiff
Add GCC warnings in debug cflags for things likely to break VC builds
authorArnaud Le Blanc <lbarnaud@php.net>
Tue, 19 May 2009 11:40:05 +0000 (11:40 +0000)
committerArnaud Le Blanc <lbarnaud@php.net>
Tue, 19 May 2009 11:40:05 +0000 (11:40 +0000)
(-Wpointer-arith -Wdeclaration-after-statement)

Zend/Zend.m4

index df5436b992b726c3b5b51e8f32fb4eb37da07b0e..a5bc223457790288357e5748d43d265bf5049bc0 100644 (file)
@@ -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