https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92210
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |msebor at gcc dot gnu.org Component|c |middle-end --- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> --- Clang also diagnoses more interesting cases where the control variable is used so if GCC implements a similar warning (which I agree would be useful) it should handle those as well. Such an implementation would most likely need to be done later than in the front-end, so setting Component to middle-end. void f (int); int main() { for (int i = 0; i < 2; ) { f (i); } }