-Wshadow and new ANSI scoping rules
Gerald Pfeifer
pfeifer@dbai.tuwien.ac.at
Thu Dec 18 15:07:00 GMT 1997
The following code snippet results in a
warning: declaration of `i' shadows previous local
which, IMHO, is not true according to the new ANSI C++ scoping rules.
int main() {
for(int i=1; i < 9; i++);
for(int i=1; i < 9; i++);
return 0;
}
Gerald
--
Gerald Pfeifer (Jerry) Vienna University of Technology
pfeifer@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/
More information about the Gcc-bugs
mailing list