[omniORB] Warnings regarding copy ctors with new gcc

Matej Kenda matej.kenda at hermes.si
Mon Feb 2 14:16:28 GMT 2004


Hi Alex,

Thanks for pointing this out. I didn't understand the warning
completely.

I have checked the source code. Since all the ctors are code-less, there
should be no difference, but the code should be changed as you have
proposed to be correct.

The patch is then:

Index: include/omniORB4/poa.h
===================================================================
RCS file: /cvsroot/omniorb/omni/include/omniORB4/Attic/poa.h,v
retrieving revision 1.2.2.13
diff --unified -r1.2.2.13 poa.h
--- include/omniORB4/poa.h      26 Jul 2003 22:52:22 -0000      1.2.2.13
+++ include/omniORB4/poa.h      2 Feb 2004 10:37:35 -0000
@@ -682,7 +682,7 @@

   protected:
     inline ServantBase() {}
-    inline ServantBase(const ServantBase&) {}
+    inline ServantBase(const ServantBase& os) : omniServant(os) {}
     inline ServantBase& operator = (const ServantBase&) { return *this; }

     void* _do_this(const char* repoId);
@@ -706,7 +706,7 @@

   protected:
     inline RefCountServantBase() : pd_refCount(1) {}
-    inline RefCountServantBase(const RefCountServantBase&) : pd_refCount(1) {}
+    inline RefCountServantBase(const RefCountServantBase& os) : ServantBase(os), pd_refCount(1) {}
     inline RefCountServantBase& operator = (const RefCountServantBase&)
       { return *this; }



On Mon, 2004-02-02 at 11:02, Tingle, Alex wrote:
> > -    inline ServantBase(const ServantBase&) {}
> > +    inline ServantBase(const ServantBase&) : omniServant() {}
> 
> Shouldn't you be calling the base class's copy constructor rather than its
> default constructor? Like this:
> 
> -    inline ServantBase(const ServantBase&) {}
> +    inline ServantBase(const ServantBase& right) : omniServant(right) {}
> 
> 
> -Alex
> 
> --

-- 
Matej Kenda, Lead Engineer
HERMES SoftLab (www.hermes-softlab.com)
Erjavčeva 2, 5000 Nova Gorica, Slovenia




More information about the omniORB-list mailing list