Is the following code legal according to C99?
...
for(....) {
int x = 4;
...
}
...
You can assume that before line 3 the variable x was never declared.
Until now I have only found the following, but I dont think that this is enough:
A block allows a set of declarations and statements to be grouped into one syntactic unit. The initializers of objects that have automatic storage duration, and the variable length array declarators of ordinary identifiers with block scope, are evaluated and the values are stored in the objects (including storing an indeterminate value in objects without an initializer) each time the declaration is reached in the order of execution, as if it were a statement, and within each declaration in the order that declarators appear.
From page 145 of that PDF.