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 expected

warning: comparison is always false due to limited range of data type

Is there a reason for such behaviour or is this a bug?

Thanks
Guennadi

P.S. I am not subscribed to the liast, please cc.
---
Guennadi Liakhovetski

Reply via email to