This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/52050] New: -Wdeclaration-after-statement does not warn on declaration in for loop initialiser


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]