https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66773
--- Comment #12 from Daniel Marjamäki <daniel.marjamaki at gmail dot com> --- > Do you have examples of perfectly fine code where you get a warning? So, how would you fix the warning for `f`? Many programmers would "fix" it with a cast. Assuming that `s` and `u` can have arbitrary values, here is the proper code: void f(long s, unsigned long u) { if (s >= 0 && s == u) g(); } For this correct code, gcc warns.