RFC: using -Wno-variadic-macros in stage 1

Nathanael Nerode neroden@twcny.rr.com
Wed Mar 24 03:18:00 GMT 2004


Opinions on this?

Otherwise huge herds of warnings get sprung by tree.h in stage 1, even
though it's guarded by a GCC/STDC version check.  :-P

	* configure.ac: Check for -Wno-variadic-macros; don't use
	-pedantic (in stage 1 or a simple 'make all') unless it's available,
	and if it's available, use it.  Also, clean up check for
	-Wno-long-long.
	* configure: Regenerate.

Index: configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.ac,v
retrieving revision 2.24
diff -u -r2.24 configure.ac
--- configure.ac	22 Mar 2004 09:49:36 -0000	2.24
+++ configure.ac	24 Mar 2004 03:06:52 -0000
@@ -274,14 +274,6 @@
 # Check C compiler features
 # -------------------------
 
-AC_CACHE_CHECK(whether ${CC-cc} accepts -Wno-long-long,
-ac_cv_prog_cc_no_long_long,
-[save_CFLAGS="$CFLAGS"
-CFLAGS="-Wno-long-long"
-AC_TRY_COMPILE(,,ac_cv_prog_cc_no_long_long=yes,
-	       ac_cv_prog_cc_no_long_long=no)
-CFLAGS="$save_CFLAGS"])
-
 AC_PROG_CPP
 AC_C_INLINE
 
@@ -304,9 +296,38 @@
 # Warnings and checking
 # ---------------------
 
+# Check $CC warning features (if it's GCC).
+# We want to use -pedantic, but we don't want warnings about
+# * 'long long'
+# * variadic macros
+# So, we only use -pedantic if we can disable those warnings.
+
+AC_CACHE_CHECK(
+  [whether ${CC} accepts -Wno-long-long],
+  [ac_cv_prog_cc_w_no_long_long],
+  [save_CFLAGS="$CFLAGS"
+  CFLAGS="-Wno-long-long"
+  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])],
+                    [ac_cv_prog_cc_w_no_long_long=yes],
+                    [ac_cv_prog_cc_w_no_long_long=no])
+  CFLAGS="$save_CFLAGS"
+  ])
+
+AC_CACHE_CHECK(
+  [whether ${CC} accepts -Wno-variadic-macros],
+  [ac_cv_prog_cc_w_no_variadic_macros],
+  [save_CFLAGS="$CFLAGS"
+  CFLAGS="-Wno-variadic-macros"
+  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])],
+                    [ac_cv_prog_cc_w_no_variadic_macros=yes],
+                    [ac_cv_prog_cc_w_no_variadic_macros=no])
+  CFLAGS="$save_CFLAGS"
+  ])
+
 strict1_warn=
-if test $ac_cv_prog_cc_no_long_long = yes ; then
-  strict1_warn="-pedantic -Wno-long-long"
+if test $ac_cv_prog_cc_w_no_long_long = yes \
+   && test $ac_cv_prog_cc_w_no_variadic_macros = yes ; then
+  strict1_warn="-pedantic -Wno-long-long -Wno-variadic-macros"
 fi
 AC_SUBST(strict1_warn)
 

-- 
Make sure your vote will count.
http://www.verifiedvoting.org/



More information about the Gcc-patches mailing list