[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: |
Marin Ramesa |
Subject: |
Re: [PATCH 01/14] i386/i386at/kd.c: fix signed overflow (a warning from GCC) |
Date: |
Mon, 09 Dec 2013 08:20:11 +0100 |
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]
- Re: [PATCH 10/14] kern/act.c: move struct definition to a header file, (continued)
- [PATCH 12/14] vm/memory_object_proxy.c: move struct definition to a header file, Marin Ramesa, 2013/12/02
- [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 <=
- 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, 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), 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