Discussion:
[omniORB] Compiler warnings in 4.1
Tamas Kerecsen
2006-09-11 10:57:55 UTC
Permalink
Duncan,

While cleaning up some makefiles and setting warning-levels to more paranoid
heights, I noticed that the omniORB headers have a few minor issues when the
warnings are set up just right in gcc 3.4.5.

All the warnings I saw complained about one class or the other not calling
its parent class' copy constructor from its own copy constructor (I always
wondered if it would have been better to design the C++ language so copy
constructors call their parent copy constructors instead of the default
constructors). It seems like it's not a real issue, because all the parent
copy constructors are empty. But just to appease the compiler (and to
prevent a big old gotcha' moment in the future if something gets added to
the parent copy constructors), could you put in those calls to the parent
copy constructor?

Thanks,
Tamas

Here are the warnings gcc gave me:

../../../../../1kx1k/Linux/ThirdParty/omniORB/include/omniORB4/poa.h: In
copy constructor `PortableServer::ServantBase::ServantBase(const
PortableServer::ServantBase&)':

../../../../../1kx1k/Linux/ThirdParty/omniORB/include/omniORB4/poa.h:667:
warning: base class `class omniServant' should be explicitly initialized in
the copy constructor

../../../../../1kx1k/Linux/ThirdParty/omniORB/include/omniORB4/CORBA_ValueBase.h:
In copy constructor
`CORBA::DefaultValueRefCountBase::DefaultValueRefCountBase(const
CORBA::DefaultValueRefCountBase&)':

../../../../../1kx1k/Linux/ThirdParty/omniORB/include/omniORB4/CORBA_ValueBase.h:177:
warning: base class `class CORBA::ValueBase' should be explicitly
initialized in the copy constructor

../../../../../1kx1k/Linux/ThirdParty/omniORB/include/omniORB4/boxes_defs.hh:
In copy constructor `CORBA::StringValue::StringValue(const
CORBA::StringValue&)':

../../../../../1kx1k/Linux/ThirdParty/omniORB/include/omniORB4/boxes_defs.hh:33:
warning: base class `class CORBA::ValueBase' should be explicitly
initialized in the copy constructor

../../../../../1kx1k/Linux/ThirdParty/omniORB/include/omniORB4/boxes_defs.hh:
In copy constructor `CORBA::WStringValue::WStringValue(const
CORBA::WStringValue&)':
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20060910/83027c53/attachment.htm
Duncan Grisby
2006-09-18 02:30:17 UTC
Permalink
Post by Tamas Kerecsen
All the warnings I saw complained about one class or the other not calling
its parent class' copy constructor from its own copy constructor (I always
wondered if it would have been better to design the C++ language so copy
constructors call their parent copy constructors instead of the default
constructors). It seems like it's not a real issue, because all the parent
copy constructors are empty. But just to appease the compiler (and to
prevent a big old gotcha' moment in the future if something gets added to
the parent copy constructors), could you put in those calls to the parent
copy constructor?
I fixed those warnings once. Unfortunately, some other compiler (I can't
remember which, but probably Visual C++, it usually is) didn't like it,
so I had to revert it back to the version with the warnings. We'll have
to hope gcc doesn't promote it to be an error, otherwise we'll need yet
another awful macro to cope with it.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...