This is the mail archive of the gcc@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]

[RFC]: allowing c99 for-loop scope in gnu89?


We allow using many c99 features in gnu89.  How about for-loop scopes
and declaring a loop iteration variable in the initialization?  E.g.:

 >   for (int i=0; i<4; i++)
 >     printf ("i=%d\n", i);

We seem to go out of our way to stop people from doing this in
check_for_loop_decls.

I suggest allowing it in gnu89 mode but if -pedantic issue a warning.

Thoughts?

		--Kaveh
--
Kaveh R. Ghazi			Director of Systems Architecture
ghazi@caip.rutgers.edu		Qwest Solutions


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