> unsigned long x;
>
> int y()
> {
> return (x < 0);
> }
>
> This is usually a bug. Is there a way of getting gcc to warn about it?
GCC knows exactly that the expression is zero; with -O2
-fomit-frame-pointer, it generates
y:
xorl %eax,%eax
ret
However, what exactly is the "usual" bug here? That an expression can
be computed statically?
Regards,
Martin