[osg-users] Warnings in compiling...

Robert Osfield robert.osfield at gmail.com
Mon Sep 24 03:07:12 PDT 2007


HI Adrian,

This warning looks bogus to me, as the code is valid - the first
iterator is within the scope of a for loop, so should not have any
affect on any later use of another variable declared after the for
loop.  The compiler in this instance is issuing a warning on the
assumption that the developers doesn't know what he's doing and that
Standard C++ isn't really meant to properly scope variables...

Regardless of the silliness of this warning I have gone ahead and
renamed the iterator scoped in the for loop, I believe this should fix
the warning, although I can't verify as gcc 4.x correctly doesn't
issue an warning.

Robert.

On 9/24/07, Adrian Egli <3dhelp at gmail.com> wrote:
> Registry.cpp(572) : warning C4288: nonstandard extension used : 'itr' : loop
> control variable declared in the for-loop is used outside the for-loop
> scope; it conflicts with the declaration in the outer scope
>         Registry.cpp(571) : definition of 'itr' used
>         Registry.cpp(564) : definition of 'itr' ignored
> Registry.cpp(572) : warning C4288: nonstandard extension used : 'itr' : loop
> control variable declared in the for-loop is used outside the for-loop
> scope; it conflicts with the declaration in the outer scope
>         Registry.cpp(571) : definition of 'itr' used
>         Registry.cpp(564) : definition of 'itr' ignored
> Registry.cpp(572) : warning C4288: nonstandard extension used : 'itr' : loop
> control variable declared in the for-loop is used outside the for-loop
> scope; it conflicts with the declaration in the outer scope
>         Registry.cpp(571) : definition of 'itr' used
>         Registry.cpp(564) : definition of 'itr' ignored
>
> --
> ********************************************
> Adrian Egli
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>



More information about the osg-users mailing list