Hi Robert ,

We have a code using gcc with -Wextra flag and using OSG as a third party
library. It does not compile when importing <osgViewer/Viewer> failing in
 EventHandler and GUIEventHandler:

....

GUIEventHandler: In copy constructor
'osgGA::GUIEventHandler::GUIEventHandler(const osgGA::GUIEventHandler&,
const osg::CopyOp&)':


/include/osgGA/GUIEventHandler:56:9: error: base class 'class osg::Object'
should be explicitly initialized in the copy constructor [-Werror=extra]


It seems the diamond problem:


   A = osg::Object
  / \
 /   \--> Virtual inheritance
B     C
 \   /
  \ /
   D = EventHandler
   |
   |
   E = GUIEventHandler


The most derived class(E)  handles the instantiation of A (osg::Object),
but all have to be responsible in case they are the ones instantiated.


In case A is not initialized in the copy constructor of derived classes the
default constructor will be called, which seems a bug.

I've added osg::Object to the initalization list of EventHandler and
GUIEventHandler copy constructors, because both classes are instantiables.

Cheers.

Jordi Torres

Attachment: EventHandler
Description: Binary data

Attachment: GUIEventHandler
Description: Binary data

_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to