fix missing extern

Richard Henderson rth@redhat.com
Thu Aug 15 14:46:00 GMT 2002


On Thu, Aug 15, 2002 at 05:17:49PM -0400, David Edelsohn wrote:
> 	Yes, I was thinking about solutions after I sent the note.  Having
> this correctness change automatically disabled in releases, like the rest
> of the ENABLE_CHECKING machinery, would be much appreciated!

Done.


r~


        * Makefile.in (LOOSE_WARN): Remove -fno-common.
        (NOCOMMON_FLAG): New substitution point.
        (GCC_WARN_CFLAGS): Include it.
        * configure.in (ac_checking): Set nocommon_flag.
        (nocommon_flag): New substitution point.

Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.935
diff -c -p -d -u -r1.935 Makefile.in
--- Makefile.in	15 Aug 2002 00:07:54 -0000	1.935
+++ Makefile.in	15 Aug 2002 21:43:53 -0000
@@ -88,13 +88,17 @@ coverageexts = .{da,bb,bbg}
 # apply to the back end and the C front end, which may be compiled
 # with other compilers.  This is partially controlled by configure in
 # stage1, as not all versions of gcc understand -Wno-long-long.
-LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -fno-common
+LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
 STRICT_WARN = -Wtraditional @strict1_warn@
 STRICT2_WARN = -Wtraditional -pedantic -Wno-long-long
 
+# This is set by --enable-checking.  The idea is to catch forgotten
+# "extern" tags in header files.
+NOCOMMON_FLAG = @nocommon_flag@
+
 # This is how we control whether or not the additional warnings are applied.
 .-warn = $(STRICT_WARN)
-GCC_WARN_CFLAGS = $(LOOSE_WARN) $($(@D)-warn)
+GCC_WARN_CFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG)
 
 # All warnings have to be shut off in stage1 if the compiler used then
 # isn't gcc; configure determines that.  WARN_CFLAGS will be either
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.in,v
retrieving revision 1.616
diff -c -p -d -u -r1.616 configure.in
--- configure.in	9 Aug 2002 08:51:26 -0000	1.616
+++ configure.in	15 Aug 2002 21:43:53 -0000
@@ -219,11 +219,14 @@ esac
 ], 
 # Enable some checks by default for development versions of GCC
 [ac_checking=1; ac_tree_checking=1; ac_gc_checking=1; ac_rtlflag_checking=1;])
+nocommon_flag=""
 if test x$ac_checking != x ; then
   AC_DEFINE(ENABLE_CHECKING, 1,
 [Define if you want more run-time sanity checks.  This one gets a grab
    bag of miscellaneous but relatively cheap checks.])
+  nocommon_flag=-fno-common
 fi
+AC_SUBST(nocommon_flag)
 if test x$ac_tree_checking != x ; then
   AC_DEFINE(ENABLE_TREE_CHECKING, 1,
 [Define if you want all operations on trees (the basic data



More information about the Gcc-patches mailing list