This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[RFC]: allowing c99 for-loop scope in gnu89?
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: gcc at gcc dot gnu dot org
- Cc: jsm28 at cam dot ac dot uk
- Date: Wed, 19 Jun 2002 23:38:16 -0400 (EDT)
- Subject: [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