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]