]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Pass the flag -Wno-format-zero-length to gcc (if supported by gcc) while compiling...
authorBart Van Assche <bvanassche@acm.org>
Mon, 23 Jun 2008 12:11:49 +0000 (12:11 +0000)
committerBart Van Assche <bvanassche@acm.org>
Mon, 23 Jun 2008 12:11:49 +0000 (12:11 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8270

Makefile.flags.am
configure.in

index 14ad4bea59e1c7996a6b77fd7298d125292c1395..1945177470e749d6df08bb588094ef2c87352894 100644 (file)
@@ -3,6 +3,7 @@
 # performance and get whatever useful warnings we can out of gcc.
 AM_CFLAGS_BASE = -O2 -g -Wmissing-prototypes -Wall -Wshadow \
                  -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations \
+                @FLAG_W_NO_FORMAT_ZERO_LENGTH@ \
                  -fno-strict-aliasing
 
 # These flags are used for building the preload shared objects.
index a6a53a891f20e244e2160aa2986b0970ed4a23f0..3e5e233678e96210d8e6562515c41921842245c4 100644 (file)
@@ -985,6 +985,29 @@ if test x$declaration_after_statement = xyes; then
 fi
 
 
+# does this compiler support -Wno-format-zero-length ?
+
+AC_MSG_CHECKING([if gcc accepts -Wno-format-zero-length])
+
+safe_CFLAGS=$CFLAGS
+CFLAGS="-Wno-format-zero-length"
+
+AC_TRY_COMPILE(
+[ ],
+[
+  return 0;
+],
+[
+AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], [-Wno-format-zero-length])
+AC_MSG_RESULT([yes])
+],
+[
+AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], [])
+AC_MSG_RESULT([no])
+])
+CFLAGS=$safe_CFLAGS
+
+
 # does this compiler support -Wextra or the older -W ?
 
 AC_MSG_CHECKING([if gcc accepts -Wextra or -W])