[forwarded from https://launchpad.net/bugs/291780] When compiling a small test program, the compiler shows a warning I would either not expect at all, or expect it to appear for all four if-statements used in my example: $ gcc -Wextra -c promotion.c promotion.c: In function ‘main’: promotion.c:10: warning: comparison of promoted ~unsigned with unsigned promotion.c: typedef unsigned char uint8_t; int main(void) { uint8_t a = 0; uint8_t b = 0; unsigned char c = 0; unsigned char d = 0; if (a == (b ^ 0xff)) { } if (a == (d ^ 0xff)) { } if (c == (b ^ 0xff)) { } if (c == (d ^ 0xff)) { } return 0; }
*** This bug has been marked as a duplicate of 38341 ***