According to C99 standard, the scope of a variable declared in the clause statement of the for
loop is restricted in scope to that loop.
In C89 / C90, that clause is merely an optional expression.
Therefore in C89 / C90 you can confidently emulate the C99 behaviour with
{ /*open scope block*/
/* your declaration here, including possible definition*/
for (expression; ...){
}
} /*close scope block*/