[omniORB-dev] Warning in generated skeletons

Philippe Combes Philippe.Combes at ens-lyon.fr
Mon Jul 7 14:29:22 BST 2003


Hi all,

I use omniORB 4.0.1 on a Debian Linux pentium III platform, g++ 3.3.1

The coding standards of the application that I develop force the code to 
be compiled with the flags -Wall -Werror.
But omniidl generates code that is not compliant with the -Wreorder flag 
(which enabled by -Wall).

~ > cat foo.idl
interface Parent {
   long dummy0();
};
interface Child : Parent {
   long dummy1();
};

~ > omniidl -bcxx foo.idl
~ > g++ -Wall -Werror -c fooSK.cc -o fooSK.o
fooSK.cc: In constructor `_objref_Child::_objref_Child(omniIOR*, 
omniIdentity*)
    ':
fooSK.cc:306: warning: base `_objref_Parent' will be initialized after
fooSK.cc:306: warning:   base `omniObjRef'
~ >

This warning is due to the following lines in fooSK.cc :

_objref_Child::_objref_Child(omniIOR* ior, omniIdentity* id) :
    _objref_Parent(ior, id),
 

    omniObjRef(::Child::_PD_repoId, ior, id, 1)
{
   _PR_setobj(this);
}


I looked at the code of omniidl. I built up a patch, attached to this 
message, but it does not seem enough. Indeed, I patched the source code 
of omniORB-4.0.1 as well as the last CVS snapshot (july, 7th) :

cd src/lib/omniORB/omniidl_be
patch -Np0 < warning_on_base_omniObjRef_initialized_after.patch

but the omniidl generated still generates the same lines. I must confess 
I am not used to the omniORB source tree, maybe these changes should be 
reported somewhere else, but I do not know where.

Of course, this is just a warning that can be skipped using the 
-Wno-reorder flag. But it is in the generated code, not in the code of 
omniidl itself.

Hope this will be useful ...

Philippe
-------------------------------------------------
Philippe Combes. IE INRIA, LIP - ENS Lyon
46, allée d'Italie
69364 Lyon Cedex 07, France
Tel: (+33)4 72 72 84 70, Fax: (+33)4 72 72 80 80
Web Page: http://www.ens-lyon.fr/~pcombes/
-------------------------------------------------
-------------- next part --------------
diff -Naur cxx/iface.py cxx_patched/iface.py
--- cxx/iface.py	2003-03-03 16:02:30.000000000 +0100
+++ cxx_patched/iface.py	2003-07-05 15:33:04.000000000 +0200
@@ -334,7 +334,7 @@
       if objref_name.needFlatName(self._environment):
         objref_str = objref_name.flatName()
 
-      this_inherits_str = objref_str + "(ior, id),\n"
+      this_inherits_str = ",\n" + objref_str + "(ior, id)"
 
       # FIXME:
       # The powerpc-aix OMNIORB_BASE_CTOR workaround still works here
diff -Naur cxx/skel/template.py cxx_patched/skel/template.py
--- cxx/skel/template.py	2002-01-16 12:31:58.000000000 +0100
+++ cxx_patched/skel/template.py	2003-07-05 15:36:08.000000000 +0200
@@ -265,8 +265,8 @@
 
 
 @fq_objref_name@::@objref_name@(omniIOR* ior, omniIdentity* id) :
-   @inherits_str@
    omniObjRef(::@name@::_PD_repoId, ior, id, 1)@init_shortcut@
+   @inherits_str@
 {
   _PR_setobj(this);
 }


More information about the omniORB-dev mailing list