bug-hurd
[Top][All Lists]
Advanced

[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]


reply via email to

[Prev in Thread] Current Thread [Next in Thread]