This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFC: Warning fixes
- From: Daniel Jacobowitz <drow at false dot org>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: mark dot kettenis at xs4all dot nl, gdb-patches at sourceware dot org
- Date: Wed, 3 Jan 2007 13:47:12 -0500
- Subject: Re: RFC: Warning fixes
- References: <20061228195828.GA18628@nevyn.them.org> <200612282256.kBSMu65R022410@brahms.sibelius.xs4all.nl> <20061228230925.GA23775@nevyn.them.org> <uy7oq3nlm.fsf@gnu.org>
On Fri, Dec 29, 2006 at 02:15:01PM +0200, Eli Zaretskii wrote:
> > Date: Thu, 28 Dec 2006 18:09:26 -0500
> > From: Daniel Jacobowitz <drow@false.org>
> > Cc: gdb-patches@sourceware.org
> >
> > The warning is a bit annoying, though. We can't portably tell whether
> > the type of sig will be signed or unsigned. Perhaps we should force
> > sig to be an int before bounds checking, instead, and I should file a
> > GCC bug report. How's that sound to you?
>
> A GCC bug report is in order, I agree: the compiler shouldn't punish
> the programmer for its choice of data type.
I filed the moral equivalent of a bug report by asking Joseph (C front
end maintainer) about this. His reply was:
> This sort of thing is why such warnings belong in -Wextra not -Wall.
> (And not on unconditionally, as some such warnings are.)
So the warning is performing quirkily as designed, and we have a choice
whether to adapt our code to GCC's periodic quirks to use -Wextra, or
to avoid -Wextra. We decided, in the thread following my other patch,
to avoid it.
I'm going to check in the fix for this one anyway, since it's just a
single cast, in case someone wants to survey the results with -Wextra
for another target later. I'm sure it will have plenty to complain
about.
--
Daniel Jacobowitz
CodeSourcery