Hi Jannik, I've noticed this same issue with a Kubuntu 14.04 install I have, I don't recall the gcc version but it's below 5 like yours. It seems the addition of -Wshadow to the OSG_AGGRESSIVE_WARNING_FLAGS causes mahem with the compile kick out lots of ridiculous shadows reports, all these warnings related to completely benign instances of a parameter in one method being named the same as a method in the same class.
Modern versions of gcc don't have this problem and only generate valid examples of shadowing of variables that one need to be concerned about. All these instances have now been fixed so OSG master with a modern version of gcc using -Wshadow doesn't generate any warnings. I had a look to see if CMake has a variable so we can only enable -Wshadow for gcc versions >= 5 but didn't come across one. If it does then we could optional enable this warning where the compiler actually does something sensible with it. Because of this issue I checked in a change to the root CmakeLists.txt file to allow you to edit the OSG_AGGRESSIVE_WARNING_FLAGS to comment out or add flags, alternatively you can disable aggressive warnings entirely by setting OSG_AGGRESSIVE_WARNINGS to OFF. If it may be that we have to make the use of -Wshadow optional or just remove it completely. The other option is just use a modern version of gcc :-) Robert. On 2 June 2016 at 19:11, Jannik Heller <[email protected]> wrote: > Hi Robert, > > I haven't finished building yet, but right off the bat I get about a million > of these warnings: > > Code: > > /home/scrawl/Dev/osg/include/osg/Vec3us:34:58: warning: declaration of ‘g’ > shadows a member of 'this' [-Wshadow] > /home/scrawl/Dev/osg/include/osg/Vec4f:46:9: warning: declaration of ‘y’ > shadows a member of 'this' [-Wshadow] > /home/scrawl/Dev/osg/include/osg/Vec3i:53:9: warning: declaration of ‘g’ > shadows a member of 'this' [-Wshadow] > /home/scrawl/Dev/osg/include/osg/Vec3i:53:9: warning: declaration of ‘r’ > shadows a member of 'this' [-Wshadow] > /home/scrawl/Dev/osg/include/osg/Vec4f:46:9: warning: declaration of ‘x’ > shadows a member of 'this' [-Wshadow] > /home/scrawl/Dev/osg/include/osg/Vec4f: In constructor > ‘osg::Vec4f::Vec4f(const osg::Vec3f&, osg::Vec4f::value_type)’: > /home/scrawl/Dev/osg/include/osg/Vec4f:54:9: warning: declaration of ‘w’ > shadows a member of 'this' [-Wshadow] > > /home/scrawl/Dev/osg/include/osg/Viewport:34:79: warning: declaration of > ‘width’ shadows a member of 'this' [-Wshadow] > /home/scrawl/Dev/osg/include/osg/Viewport:34:79: warning: declaration of ‘y’ > shadows a member of 'this' [-Wshadow] > /home/scrawl/Dev/osg/include/osg/Viewport:34:79: warning: declaration of ‘x’ > shadows a member of 'this' [-Wshadow] > /home/scrawl/Dev/osg/include/osg/Viewport: In member function ‘void > osg::Viewport::setViewport(osg::Viewport::value_type, > osg::Viewport::value_type, osg::Viewport::value_type, > osg::Viewport::value_type)’: > /home/scrawl/Dev/osg/include/osg/Viewport:80:9: warning: declaration of > ‘height’ shadows a member of 'this' [-Wshadow] > > /home/scrawl/Dev/osg/include/osg/Image: In member function ‘void > osg::Image::scaleImage(int, int, int)’: > /home/scrawl/Dev/osg/include/osg/Image:218:44: warning: declaration of ‘r’ > shadows a member of 'this' [-Wshadow] > void scaleImage(int s,int t,int r) { scaleImage(s,t,r, > getDataType()); } > ^ > /home/scrawl/Dev/osg/include/osg/Image:218:44: warning: declaration of ‘t’ > shadows a member of 'this' [-Wshadow] > /home/scrawl/Dev/osg/include/osg/Image:218:44: warning: declaration of ‘s’ > shadows a member of 'this' [-Wshadow] > > > > > I'm using g++ 4.8.4. > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=67357#67357 > > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

