This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: should we use -Werror? (& sample patch to do it)
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: RFC: should we use -Werror? (& sample patch to do it)
- From: Zack Weinberg <zack at codesourcery dot com>
- Date: Wed, 5 Sep 2001 11:16:57 -0700
- Cc: gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- References: <200109051759.NAA20621@caip.rutgers.edu>
On Wed, Sep 05, 2001 at 01:59:43PM -0400, Kaveh R. Ghazi wrote:
> > > 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.
Yes. When I said zero, I meant zero machine-independent warnings. We
aren't even there yet, and I think it's simply because the remaining
MI warnings are such a pain to deal with - combine.c comparing mode
bitsizes to rtx integer slots, e.g.
Or there's the cp/error.c mess, which the only sane thing to do with
it is finish rewriting it in terms of diagnostic.c, and *that*'s a
lack-of-time issue; it's been on my list for about a year now.
> 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.
See, that's nice in theory, but I bet you "temporary" is measured in
years.
(There are cleaner ways to do the same thing, e.g. look at the hack
used to avoid -pedantic for the non-C front ends.)
> > 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.)
Not true. -Werror turns _all_ warnings into errors.
zw