https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65178
Bug ID: 65178 Summary: incorrect -Wmaybe-uninitialized when nested loops Product: gcc Version: 4.9.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: winter-...@bfw-online.de Created attachment 34845 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34845&action=edit Testcase This program incorrectly warns about an uninitialized variable. If one is to delete the innermost loop definition (leaving the loop body intact), the warning would not be displayed. --- main.c 2015-02-23 16:48:56.027694790 +0100 +++ main2.c 2015-02-23 16:49:13.585385504 +0100 @@ -10,7 +10,7 @@ { char *buf; char *p = 0; for (bool a = true;; a = false) - { for (char *s = c; *s; ++s) + { // for (char *s = c; *s; ++s) { if (!a) *p = 'a'; } if (!a) break;