http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47729
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |ebotcazou at gcc dot | |gnu.org Resolution| |FIXED Severity|normal |major --- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-02-14 10:12:24 UTC --- > Unfortunately I don't receive warning message when comparing signed and > unsigned integers within a function. > > When comparing with >, >=, < or <=, it gives me a warning message. > > Only when comparing with != inside a function does the warning message not > appear. This is rather confused. You don't get the warning on line 19 because the function template is instantiated with n/size equal to the constant 4u, so there is no real need to warn here. The relevant comment in the source code of the compiler is: /* Do not warn if the comparison is an equality operation, the unsigned quantity is an integral constant, and it would fit in the result if the result were signed. */