[committed] Use -Wold-style-definition in stage 1 if available

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


Bootstrapped i686-pc-linux-gnu, committing.

Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 2.3281
diff -u -r2.3281 ChangeLog
--- ChangeLog	24 Mar 2004 17:19:58 -0000	2.3281
+++ ChangeLog	24 Mar 2004 18:00:58 -0000
@@ -1,3 +1,10 @@
+2004-03-24  Nathanael Nerode  <neroden@gcc.gnu.org>
+
+	* Makefile.in (STRICT2_WARN): Reorder.
+	* configure.ac: Check for -Wold-style-definition, and use it
+	in strict1_warn if it's available.
+	* configure: Regnerate.
+
 2004-03-24  Paul Brook  <paul@nowt.org>
 
 	* config.gcc <arm>: Add --with-abi=
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.1265
diff -u -r1.1265 Makefile.in
--- Makefile.in	22 Mar 2004 22:05:01 -0000	1.1265
+++ Makefile.in	24 Mar 2004 18:00:48 -0000
@@ -163,8 +163,8 @@
 # -Wno-variadic-macros.
 LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
 STRICT_WARN = @strict1_warn@
-STRICT2_WARN = -pedantic -Wno-long-long -Wold-style-definition \
-  -Wno-variadic-macros @WERROR@
+STRICT2_WARN = -pedantic -Wno-long-long -Wno-variadic-macros \
+  -Wold-style-definition @WERROR@
 
 # This is set by --enable-checking.  The idea is to catch forgotten
 # "extern" tags in header files.
Index: configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.ac,v
retrieving revision 2.25
diff -u -r2.25 configure.ac
--- configure.ac	24 Mar 2004 16:26:00 -0000	2.25
+++ configure.ac	24 Mar 2004 18:00:49 -0000
@@ -331,6 +331,21 @@
 fi
 AC_SUBST(strict1_warn)
 
+# Add -Wold-style-definition if it's accepted
+AC_CACHE_CHECK(
+  [whether ${CC} accepts -Wold-style-definition],
+  [ac_cv_prog_cc_w_old_style_definition],
+  [save_CFLAGS="$CFLAGS"
+  CFLAGS="-Wold-style-definition"
+  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])],
+                    [ac_cv_prog_cc_w_old_style_definition=yes],
+                    [ac_cv_prog_cc_w_old_style_definition=no])
+  CFLAGS="$save_CFLAGS"
+  ])
+if test $ac_cv_prog_cc_w_old_style_definition = yes ; then
+  strict1_warn="${strict1_warn} -Wold-style-definition"
+fi
+
 # If the native compiler is GCC, we can enable warnings even in stage1.  
 # That's useful for people building cross-compilers, or just running a
 # quick `make'.

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



More information about the Gcc-patches mailing list