[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 01/14] i386/i386at/kd.c: fix signed overflow (a warning from
From: |
Richard Braun |
Subject: |
Re: [PATCH 01/14] i386/i386at/kd.c: fix signed overflow (a warning from GCC) |
Date: |
Mon, 9 Dec 2013 11:28:24 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Dec 09, 2013 at 11:07:46AM +0100, Marin Ramesa wrote:
> On 09.12.2013 11:00:12, Richard Braun wrote:
> > On Mon, Dec 09, 2013 at 08:20:11AM +0100, Marin Ramesa wrote:
> > > On 08.12.2013 15:25:42, Samuel Thibault wrote:
> > > > Marin Ramesa, le Mon 02 Dec 2013 22:54:39 +0100, a écrit :
> > > > > -for ( ; (c != K_DONE) && (char_idx <= max);
> > > > > +for ( ; ((char)c != K_DONE) && (char_idx <= max);
> > > >
> > > > I have rather made K_DONE an unsigned, simply. It definitely has
> > > > to be an unsigned anyway, since it's 0xff...
> > >
> > > There's still a warning from GCC, even after the change. I don't
> > > know why GCC complains about this comparison. Everything looks
> > > good to me now. Here's the warning:
> > >
> > > cc1: warning: assuming signed overflow does not occur when assuming
> > > that (X - c) <= X is always true [-Wstrict-overflow]
> >
> > Remove your explicit cast, make K_DONE an unsigned.
>
> I have removed it and Samuel made it unsigned and there is still a
> warning.
Could the warning apply to char_idx and max instead ?
--
Richard Braun
- [PATCH 11/14] kern/lock.c: move struct definition to a header file, (continued)
- [PATCH 11/14] kern/lock.c: move struct definition to a header file, Marin Ramesa, 2013/12/02
- [PATCH 13/14] vm/vm_fault.c: move struct definition to a header file, Marin Ramesa, 2013/12/02
- [PATCH 14/14] vm/vm_resident.c: move struct definition to a header file, Marin Ramesa, 2013/12/02
- Re: [PATCH 01/14] i386/i386at/kd.c: fix signed overflow (a warning from GCC), Samuel Thibault, 2013/12/08
- Re: [PATCH 01/14] i386/i386at/kd.c: fix signed overflow (a warning from GCC), Marin Ramesa, 2013/12/09
- Re: [PATCH 01/14] i386/i386at/kd.c: fix signed overflow (a warning from GCC), Richard Braun, 2013/12/09
- Re: [PATCH 01/14] i386/i386at/kd.c: fix signed overflow (a warning from GCC), Marin Ramesa, 2013/12/09
- Re: [PATCH 01/14] i386/i386at/kd.c: fix signed overflow (a warning from GCC),
Richard Braun <=
- Re: [PATCH 01/14] i386/i386at/kd.c: fix signed overflow (a warning from GCC), Samuel Thibault, 2013/12/09
- Re: [PATCH 01/14] i386/i386at/kd.c: fix signed overflow (a warning from GCC), Richard Braun, 2013/12/09
- Re: [PATCH 01/14] i386/i386at/kd.c: fix signed overflow (a warning from GCC), Samuel Thibault, 2013/12/09
- Re: [PATCH 01/14] i386/i386at/kd.c: fix signed overflow (a warning from GCC), Marin Ramesa, 2013/12/09
- Re: [PATCH 01/14] i386/i386at/kd.c: fix signed overflow (a warning from GCC), Samuel Thibault, 2013/12/15