Re: RFC: Warning fixes

Daniel Jacobowitz
2007-01-03T18:47:22Z

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.