This is the mail archive of the
mailing list for the GCC project.
Re: RFC: should we use -Werror? (& sample patch to do it)
- To: zack at codesourcery dot com
- Subject: Re: RFC: should we use -Werror? (& sample patch to do it)
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Wed, 5 Sep 2001 13:59:43 -0400 (EDT)
- Cc: gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
> From: Zack Weinberg <firstname.lastname@example.org>
> On Tue, Sep 04, 2001 at 11:32:50PM -0400, Kaveh R. Ghazi wrote:
> > I got warning levels down to around 30 on solaris2.7 and 20 on irix6.
> > So I thought it might be worth a try to get -Werror installed in gcc.
> > Anyway, another problem is we have to get to zero warnings before
> > using -Werror. I propose doing it one module at a time. The patch
> > below is a candidate which does this for rtl.o to start with. If that
> > lasts for a week without major pandemonium, we can do more files.
> I think this is backward. First we should get to zero warnings
> throughout the compiler, _then_ we talk about -Werror. If only
> because if we do it your way, we'll be adding explicit compile rules
> to module after module. I don't think there's enough marginal benefit
> from -Werror applied to a few modules, to eat that kind of complexity
> burden in the Makefile which is already too complicated.
The problem with getting to zero is each platform is likely to have
its own special warnings stemming either from the config directory
files or from platform specific wierdness. We simply cannot get to
zero on all platforms on all modules unless everyone makes a concerted
effort and no regressions occur. I might very well get solaris2 down
to zero but I bet other platforms would not be zero unless someone
volunteers to look at those. I find that highly unlikely, we've
hovered at 100-200 warnings for a year or so. Without -Werror to
force people, regressions creep in at several per week sometimes.
I thought starting with one file would ease people in slowly. Once we
got the whole compiler I would take out the individual rules and put
it in the .c.o rule or into GCC_WARN_CFLAGS or something. So whatever
extra complexity added would be temporary.
> Instead, we should be talking seriously about the remaining N
> warnings, and what we're going to do about them. I saw a couple of
> patches go by for the 20-odd signed/unsigned comparison warnings in
> combine.c, which is the majority of the remaining warnings; they
> haven't been reviewed.
> Next biggest offender is
> 7 string length `???' is greater than the length `???' ISO C89
> compilers are required to support
> These are more or less intractable: they come from big hairy spec
> strings, e.g.
IIRC, these string warnings are from -pedantic, which isn't affected
by -Werror. To make those hard errors, I think you have to use
-pedantic-errors. (Again, IIRC.)
Kaveh R. Ghazi Engagement Manager / Project Services
email@example.com Qwest Internet Solutions