This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question on -Werror usage in Makefiles...
> From: Andreas Jaeger <aj@suse.de>
>
> > Since then there seems to be more acceptance of -Werror, and it may be
> > that we can count on the community at large to fix their own warnings
> > on their respective targets. So there's no reason we can't use
> > -Werror on target files too. It's just a matter of someone
> > volunteering to champion it and fix some of the most common problems.
> > (I don't have the time myself to be point person.) There will
> > undoubtedly be some naysayers, but I think the feasibility of using
> > -Werror so far has been self-evident.
> >
> > If you are interested I would encourage you to proceed. I'll pitch in
> > as time permits and back you up if you decide to give it a go.
>
> Do you have a patch? In that case I would suggest that some of us
> apply it locally and try to kill those warnings that remain - and
> let's then decide whether it's ok to add it per default.
>
> Andreas
Untested, but this should work:
diff -rup orig/egcc-CVS20031026/gcc/Makefile.in egcc-CVS20031026/gcc/Makefile.in
--- orig/egcc-CVS20031026/gcc/Makefile.in 2003-10-24 20:01:05.000000000 -0400
+++ egcc-CVS20031026/gcc/Makefile.in 2003-10-26 11:09:42.753409000 -0500
@@ -275,7 +275,7 @@ GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./x
# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
# It omits XCFLAGS, and specifies -B./.
# It also specifies -isystem ./include to find, e.g., stddef.h.
-GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(LOOSE_WARN) -isystem ./include $(TCFLAGS)
+GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(LOOSE_WARN) @WERROR@ -isystem ./include $(TCFLAGS)
# ---------------------------------------------------
# Programs which produce files for the target machine