[Bf-committers] Compiler error with MSVC6 on SG_Tree.cpp

Stephen Swaney bf-committers@blender.org
Mon, 17 May 2004 16:39:35 -0500


Douglas Toltzman wrote:
> 
> For these errors, you'll need to declare x and y one time and remove the
> declarations in the for (...;...;...) constructs.
> 
> e.g.
> Add a line at 271 that reads; "unsigned int x;"
> 
> Then inside the "for ( unsigned int x ..." remove the "unsigned int".
> Repeat the "unsigned int" removal for the next "for ( unsigned int x..."
> line a little further down.  What you are seeing is a scoping error.
> 

This compiler is hosed.  In C++, the params declared in a 
for loop, like the x in for( int x = 0; ..., are local to 
that for loop.

They have no life outside the loop.

-- 
Stephen Swaney			
sswaney@swbell.net