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.