I'm suggesting that there's no big difference between unsigned char and
unsigned int (and unsigned long...) in this case, and, therefore
compiler's behaviour should be consistent.
But there is a difference.
When "x" is an unsigned int, the expression "x < 0" is equivalent to
(unsigned i
Hi Segher,
On Wed, 4 Jun 2008, Segher Boessenkool wrote:
> > I just discovered a behaviour in gcc-4, which I don't understand: code
> >
> > unsigned int x;
> >
> > if (x < 0)
> > do_something();
> >
> > compiled with -Wall doesn't produce a warning, and the call to
> > do_s
I just discovered a behaviour in gcc-4, which I don't understand: code
unsigned int x;
if (x < 0)
do_something();
compiled with -Wall doesn't produce a warning, and the call to
do_something() is silently dropped, whereas if x is of type unsigned
char,
I get as
I just discovered a behaviour in gcc-4, which I don't understand: code
unsigned int x;
if (x < 0)
do_something();
compiled with -Wall doesn't produce a warning, and the call to
do_something() is silently dropped, whereas if x is of type unsigned char,
I get as e