Alexander Myodov <[EMAIL PROTECTED]> wrote: > >> "for (int i = 0; i < 10; i++)" works fine nowadays. > JC> I'm sorry, but you are wrong. The C99 spec states that you must define > JC> the type of i before using it in the loop. Maybe you are thinking of > JC> C++, which allows such things. > "gcc -std=c99" compiles the line "for (int i = 0; i <= 5; i++);" > perfectly. Along with another sample mentioned above . > To this day, I relied upon gcc in terms of standards compatibility...
I misread the error message from my compiler. It /only/ works in C99 mode. Previous C standards (which CPython itself conforms to) did not allow such things. Interestingly enough, not all C++ compilers (Microsoft) hid variables created in for loops (http://www.devx.com/cplus/10MinuteSolution/28908/0/page/2). - Josiah _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com