https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44677
--- Comment #20 from Eyal Rozenberg <eyalroz1 at gmx dot com> --- (In reply to Vincent Lefèvre from comment #19) > However, the i++ is not completely useless, as this is a way to tell the > compiler that the number of iterations is bounded by INT_MAX I wouldn't say that. I mean, it's true (IIANM) taht after the overflow, we hit undefined behavior territory, meaning that the compiler can break from the loop. But that is the compiler's prerogative, it is not the programmer "telling" the compiler something concrete. If you're worried about programmers being able to offer these hints to GCC, expecting it to behave a certain way, without getting a warning - I would say that does not justify not-warning; and can be accounted for by, say, considering `(void) i;` as a use, or explicit warning suppression etc.