[Bug c/45464] Warning missing using -Wall when comparing unsigned int and sum of unsigned chars.

2021-09-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45464 --- Comment #3 from Andrew Pinski --- Actually I think only the warning for the three add case is wrong and here is why: adding two (unsigned) 8bit integers together will only give you a max a 9bit integer. so comparing b and (a+a) is fine Addin

[Bug c/45464] Warning missing using -Wall when comparing unsigned int and sum of unsigned chars.

2010-09-30 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45464 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug c++/45464] Warning missing using -Wall when comparing unsigned int and sum of unsigned chars.

2010-08-31 Thread brutus at free dot fr
--- Comment #1 from brutus at free dot fr 2010-08-31 13:53 --- There is a small mystake to the snippet, it should read instead: int main() { unsigned char a = 0; unsigned int b = 0; bool test1 =( b < a + a); bool test2 =( b < a + a + a); if (test1 && test2) return 1; } --