This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: Enforce -Werror during bootstrap


 >  > You've got the complexity burden down as far as it's going to go,
 >  > but think about the consequence of this: there's eventually going
 >  > to be a long long list of
 >  > 
 >  > foobar.o-warn = $(WERROR_FLAGS)
 >  > 
 >  > which will, I venture to guess, never go away.  Now think about
 >  > what will happen when (not if) you start needing to conditionalize
 >  > this on target triples.
 >  > zw
 > 
 > Zack - I disagree with you about getting to zero warnings first.
 > However I do see your point about the long long list of foobar.o-warn
 > settings.
 > 
 > How about doing the reverse?  We make -Werror the default and put in
 > the explicit settings to turn it back off (-Wno-error) for only those
 > files which have warnings right now.  Then instead of a growing list
 > of -Werror that is permanent, we get a shrinking list of -Wno-error as
 > we clean up more and more files.  The initial patch will be more
 > complex, but over time it will slowly get smaller.
 > 	     --Kaveh


Zack - Here's what I meant.  This patch survives bootstrap on
sparc-sun-solaris2.7.  As you can see, the list of bypass files is
rather small and I can zap a few more pretty easily.  A benefit of
this patch (as opposed to the previous one) is that as new files get
added to GCC we don't have to remember to add -Werror, it happens
automatically.

I can also address your point about needing to conditionalize on
target triples by adding bypass elements to individual target makefile
fragments if/when necessary.

I expect a few bypass files may need to be added due to target
specific issues.  I'm going to do some cross-compiles to the "primary"
platforms to see what I get.

However, does this approach address your concerns?

		Thanks,
		--Kaveh


diff -rup orig/egcc-CVS20030113/gcc/Makefile.in egcc-CVS20030113/gcc/Makefile.in
--- orig/egcc-CVS20030113/gcc/Makefile.in	Mon Jan 13 16:00:20 2003
+++ egcc-CVS20030113/gcc/Makefile.in	Tue Jan 14 11:45:36 2003
@@ -109,7 +109,17 @@ VALGRIND_DRIVER_DEFINES = @valgrind_path
 
 # This is how we control whether or not the additional warnings are applied.
 .-warn = $(STRICT_WARN)
-GCC_WARN_CFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG)
+GCC_WARN_CFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG) $(WERROR) $($@-warn)
+
+# These files (and only these) are to have -Werror bypassed in stage2.
+gtype-desc.o-warn = -Wno-error
+c-decl.o-warn = -Wno-error
+loop.o-warn = -Wno-error
+varasm.o-warn = -Wno-error
+gcc.o-warn = -Wno-error
+# Bison-1.75 yields (harmless) -Wtraditional warnings
+gengtype-yacc.o-warn = -Wno-error
+c-parse.o-warn = -Wno-error
 
 # 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
@@ -3342,6 +3352,7 @@ STAGE2_FLAGS_TO_PASS = \
 	CFLAGS="$(BOOT_CFLAGS)" \
 	LDFLAGS="$(BOOT_LDFLAGS)" \
 	WARN_CFLAGS="\$$(GCC_WARN_CFLAGS)" \
+	WERROR="-Werror" \
 	STRICT_WARN="$(STRICT2_WARN)" \
 	libdir=$(libdir) \
 	LANGUAGES="$(LANGUAGES)" \
diff -rup orig/egcc-CVS20030113/gcc/cp/Make-lang.in egcc-CVS20030113/gcc/cp/Make-lang.in
--- orig/egcc-CVS20030113/gcc/cp/Make-lang.in	Thu Jan  9 22:15:06 2003
+++ egcc-CVS20030113/gcc/cp/Make-lang.in	Tue Jan 14 11:40:10 2003
@@ -90,6 +90,7 @@ CXX_OBJS = cp/call.o cp/decl.o cp/expr.o
 
 # Use loose warnings for this front end.
 cp-warn =
+cp/decl.o-warn = -Wno-error
 
 cc1plus$(exeext): $(CXX_OBJS) $(CXX_C_OBJS) $(BACKEND) \
 		  libcpp.a $(LIBDEPS)
diff -rup orig/egcc-CVS20030113/gcc/f/Make-lang.in egcc-CVS20030113/gcc/f/Make-lang.in
--- orig/egcc-CVS20030113/gcc/f/Make-lang.in	Thu Jan  9 07:00:58 2003
+++ egcc-CVS20030113/gcc/f/Make-lang.in	Tue Jan 14 11:31:48 2003
@@ -93,6 +93,8 @@ F77_OBJS = f/bad.o f/bit.o f/bld.o f/com
 
 # Use loose warnings for this front end.
 f-warn =
+# type-punning warning
+f/sta.o-warn = -Wno-error
 
 f771$(exeext): $(F77_OBJS) $(BACKEND) $(LIBDEPS)
 	rm -f f771$(exeext)
diff -rup orig/egcc-CVS20030113/gcc/java/Make-lang.in egcc-CVS20030113/gcc/java/Make-lang.in
--- orig/egcc-CVS20030113/gcc/java/Make-lang.in	Sat Jan 11 21:42:25 2003
+++ egcc-CVS20030113/gcc/java/Make-lang.in	Tue Jan 14 11:31:50 2003
@@ -124,6 +124,12 @@ JVGENMAIN_OBJS = java/jvgenmain.o java/m
 
 # Use loose warnings for this front end.
 java-warn =
+# Comparison signed/unsigned
+java/jcf-write.o-warn = -Wno-error
+# Patch pending...
+java/builtins.o-warn = -Wno-error
+# String length warnings
+jvspec.o-warn = -Wno-error
 
 jc1$(exeext): $(JAVA_OBJS) $(BACKEND) $(LIBDEPS)
 	rm -f $@
diff -rup orig/egcc-CVS20030113/gcc/objc/Make-lang.in egcc-CVS20030113/gcc/objc/Make-lang.in
--- orig/egcc-CVS20030113/gcc/objc/Make-lang.in	Fri Jan 10 23:25:04 2003
+++ egcc-CVS20030113/gcc/objc/Make-lang.in	Tue Jan 14 11:31:50 2003
@@ -47,6 +47,8 @@ OBJECTIVE-C objective-c: cc1obj$(exeext)
 
 # Use maximal warnings for this front end.
 objc-warn = $(STRICT_WARN)
+# Bison-1.75 yields (harmless) -Wtraditional warnings
+objc/objc-parse.o-warn = -Wno-error
 
 # Language-specific object files for Objective C.
 OBJC_OBJS = objc/objc-lang.o objc/objc-parse.o objc/objc-act.o


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]