Richard said:
CBFalconer said:
How do you reconcile your opinion with what the Standard says in
3.1.2.1 of C89 (or 6.2.1(4) of C99), given that the Standard's
take on the matter appears to be diametrically opposite to yours?
That seems (to me) to define the end of the scope. I am worrying
about the start. I don't see how that can precede reading the
statement involved.
[#4] Every other identifier has scope determined by the
placement of its declaration (in a declarator or type
specifier). If the declarator or type specifier that
declares the identifier appears outside of any block or list
of parameters, the identifier has file scope, which
terminates at the end of the translation unit. If the
declarator or type specifier that declares the identifier
appears inside a block or within the list of parameter
declarations in a function definition, the identifier has
block scope, which terminates at the end of the associated
block. If the declarator or type specifier that declares
the identifier appears within the list of parameter
declarations in a function prototype (not part of a function
definition), the identifier has function prototype scope,
which terminates at the end of the function declarator. If
an identifier designates two different entities in the same
name space, the scopes might overlap. If so, the scope of
one entity (the inner scope) will be a strict subset of the
scope of the other entity (the outer scope). Within the
inner scope, the identifier designates the entity declared
in the inner scope; the entity declared in the outer scope
is hidden (and not visible) within the inner scope.