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 10:35:13 -0700
- Cc: gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- References: <200109050332.XAA14648@caip.rutgers.edu>
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.
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.
"%{E|M|MM:cpp0 -lang-c++ %{!no-gcc:-D__GNUG__=%v1}\
%{!Wno-deprecated:-D__DEPRECATED}\
%{!fno-exceptions:-D__EXCEPTIONS}\
-D__GXX_ABI_VERSION=100\
%{ansi:-D__STRICT_ANSI__ -trigraphs -$} %(cpp_options)}\
%{!E:%{!M:%{!MM:\
%{save-temps:cpp0 -lang-c++ \
%{!no-gcc:-D__GNUG__=%v1}\
%{!Wno-deprecated:-D__DEPRECATED}\
%{!fno-exceptions:-D__EXCEPTIONS}\
-D__GXX_ABI_VERSION=100\
%{ansi:-D__STRICT_ANSI__ -trigraphs -$}\
%(cpp_options) %b.ii \n}\
cc1plus %{save-temps:-fpreprocessed %b.ii}\
%{!save-temps:%(cpp_options)\
%{!no-gcc:-D__GNUG__=%v1} \
%{!Wno-deprecated:-D__DEPRECATED}\
%{!fno-exceptions:-D__EXCEPTIONS}\
-D__GXX_ABI_VERSION=100\
%{ansi:-D__STRICT_ANSI__}}\
%{ansi:-trigraphs -$}\
%(cc1_options) %2 %{+e1*}\
%{!fsyntax-only:%(invoke_as)}}}}",
Anyone have a good suggestion for what to do about that, I would
*love* to hear it. (Short of Neil's driver rewrite, which isn't
happening fast enough to help.)
zw