Why do I get "error: name lookup of `i' changed for new ISO `for' scoping" error compiling old C++ code with latest g++?
This is
not strictly a migration problem but more an issue of hitting new ISO
C++ rules that probably weren't around when the code you are migrating
to Linux was originally written.
The latest ISO standard imposes new rules on the scope of variables
used in for loops. The cause for the compilation error is
probably because you have some code that looks something like:
for (i=0; i < 10; i++) {
.... code here
.....
}
i = 0;
The problem is that under new scoping rules the local automatic
variable i is limited to the for loop and cannot be accessed outside
the loop.
|