|
From: <sv...@va...> - 2008-06-23 12:11:54
|
Author: bart
Date: 2008-06-23 13:11:49 +0100 (Mon, 23 Jun 2008)
New Revision: 8270
Log:
Pass the flag -Wno-format-zero-length to gcc (if supported by gcc) while compiling tools. This flag only affects those tools for which -Wformat is enabled (at this time only exp-drd).
Modified:
trunk/Makefile.flags.am
trunk/configure.in
Modified: trunk/Makefile.flags.am
===================================================================
--- trunk/Makefile.flags.am 2008-06-23 11:43:28 UTC (rev 8269)
+++ trunk/Makefile.flags.am 2008-06-23 12:11:49 UTC (rev 8270)
@@ -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.
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in 2008-06-23 11:43:28 UTC (rev 8269)
+++ trunk/configure.in 2008-06-23 12:11:49 UTC (rev 8270)
@@ -985,6 +985,29 @@
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])
|