http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52050

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
            Summary|-Wdeclaration-after-stateme |Want an option to warn
                   |nt does not warn on         |about a declaration inside
                   |declaration in for loop     |a for/while/if statements.
                   |initialiser                 |

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-01-30 
00:36:54 UTC ---
I think -Wdeclaration-after-statement would the wrong option really.  
The declaration in "for (int i = 0; i < 2; i++)" is not after a statement.  I
would think we should have a different warning option for this.  Also the
warning option is there mostly to warn as we turn on this extension by default
for GNU C90 while the declaration inside a for loop support is not turned on
for GNU C90.

Reply via email to