This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/52050] New: -Wdeclaration-after-statement does not warn on declaration in for loop initialiser
- From: "mans at mansr dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 29 Jan 2012 22:50:24 +0000
- Subject: [Bug c/52050] New: -Wdeclaration-after-statement does not warn on declaration in for loop initialiser
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52050
Bug #: 52050
Summary: -Wdeclaration-after-statement does not warn on
declaration in for loop initialiser
Classification: Unclassified
Product: gcc
Version: 4.6.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: mans@mansr.com
Consider this code:
void foo(void)
{
for (int i = 0; i < 2; i++);
}
Compiling the above code with -std=c99 -Wdeclaration-after-statement
does not produce a warning as expected.