[omniORB] gcc 4.0.0 patches for omniORB - try #2

Raschick hartmut.raschick at keymile.com
Thu Jul 21 20:03:56 BST 2005


[applies to omniORB-4.0.6 and possibly below]

Hi,
please find attached 3 "fixes" for omniorb-4.0.6:
Compile env was Mac Os X 10.4.1 using Apple's gcc 4.0 (upgraded to the version
which is  (acc. to Apple) synched w/FSF gcc 4.0.0 - the one from XCode 2.1)

I'd say, items 1. and 2. are not visible in the distro build due to the chosen
compiler flags there (I haven't done a distro build w/the upgraded compiler
yet); not so sure about #3. though. So, I found these when compiling my code
w/"gcc -ansi -Wall -pedantic -W" (rather telling, I know...)
Whereas items 1 and 2 will only lead to warnings, item 3 will break the compile.

I have, unfortunately, no Linux to check this (w/gcc 4.0.0), but so far I have
found Apple to be rather reliable in this respect.

1. include/omniORB4/poa.h
When gcc 4.0 was in stage 3 or something and people started to compile w/it
a warning popped up when compiling client code about the copy constructors of
ServantBase and RefCountServantBase not honoring their base classes. This was
already fixed, however, at least Apple's gcc still complaines about
RefCountServantBase.
This, apparently, isn't enough
--snip------------------------------------------------------------------------
     inline RefCountServantBase(const RefCountServantBase& os): ServantBase(os), 
pd_refCount(1) {}
--snap------------------------------------------------------------------------
the compiler wants that
--snip------------------------------------------------------------------------
     inline RefCountServantBase(const RefCountServantBase& os): omniServant(os), 
ServantBase(os), pd_refCount(1) {}
--snap------------------------------------------------------------------------
I must say that I don't really understand this (not that an expert to say the
least) as RefCountServantBase explicitely calls ServantBase, which in turn
explicitely calls omniServant, however, I thought I'd point it out.
-> this is IMHO also what this
--snip------------------------------------------------------------------------
http://www.omniorb-support.com/pipermail/omniorb-list/2005-June/026780.html
--snap------------------------------------------------------------------------
is talking about.

2. include/omniORB4/callHandle.h
According to the said gcc, PostInvokeHook wants a virtual destructor due to
having virtual functions. Well, this too, looks to me more like cosmetics
(as PostInvokeHook _by_itself_ is doing an awful lot ;-) ).
--snip------------------------------------------------------------------------
   class PostInvokeHook {
   public:
     virtual ~PostInvokeHook(void) {};
     virtual void postinvoke() = 0;
   };
--snap------------------------------------------------------------------------

3. src/lib/omniORB/omniidl_be/cxx/header/template.py
Apparently, starting w/gcc 4.0.0 private member access via "friend" must be
desclared like this (@least when you do -ansi -Wall -pedantic -W ;-) ):
--snip------------------------------------------------------------------------
friend class ::@private_prefix at _tcParser_unionhelper_@name@;
--snap------------------------------------------------------------------------
I just expanded the #if macro from
--snip------------------------------------------------------------------------
#if defined(__GNUG__) || defined(__DECCXX) && (__DECCXX_VER < 60000000)
--snap------------------------------------------------------------------------
to
--snip------------------------------------------------------------------------
#if defined(__GNUG__) && (__GNUG__ < 4) || defined(__DECCXX) && (__DECCXX_VER < 
60000000)
--snap------------------------------------------------------------------------

For reference, I have attached all three files as taken from 
omniORB-4.0.6.tar.gz _in_their_changed_form (so you would be able to diff them).

I hope this helps (in whatever way).

P.S.: Three addresses always inspire confidence, even in tradesmen.
         - Oscar Wilde (1854-1900)

-- 
Hartmut "Hardy" Raschick / R&D Network Management
KEYMILE GmbH
-------------- next part --------------
A non-text attachment was scrubbed...
Name: omniORB-4.0.6-gcc-4.0.0-patch.tar.gz
Type: application/x-gzip
Size: 14554 bytes
Desc: not available
Url : http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20050721/27a2ae85/omniORB-4.0.6-gcc-4.0.0-patch.tar-0001.bin


More information about the omniORB-list mailing list