[Bug c/66773] sign-compare warning for == and != are pretty useless

segher at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Nov 19 18:32:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66773

--- Comment #8 from Segher Boessenkool <segher at gcc dot gnu.org> ---
int f0(void) { return 0xffffffff == -1; }
int f1(unsigned x) { return x == -1; }
int f2(int y) { return 0xffffffff == y; }
int f3(unsigned x, int y) { return x == y; }


All of them warn the same, and that is good, imo.


More information about the Gcc-bugs mailing list