E
Eric Sosman
Richard said:But because names in a new scope can shadow outer ones, you have the
problem of inadvertent "variable capture", for example:
#define macro(x) {int t = (x)*2; ...}
...
int t;
macro(t+4);
There are obvious conventions to reduce the problem, but these are
likely to fail if you might have nested macro calls.
Correct me if I'm wrong (it's been known to happen ...),
but I think there's no problem with the example shown. The
scope of the "inner" t begins at the end of its declarator
(6.2.1/7), and the initialization is part of the declarator
(6.7/1). Therefore, in the expanded `int t = (t + 4) * 2;'
the initializer's t refers to the "outer" variable, not to the
variable being initialized.