[omniORB] gcc 3.0 with omniORB

Leandro Fanzone leandro@hasar.com
Tue, 26 Jun 2001 16:02:32 -0300


--------------B4E34EA5FB571AB570AB9B64
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Compiling omniORB 3.0.3 with gcc 3.0, I had a small problem: namespaces seem not
to be defined. I have found at CORBA_sysdep.h:237 the following lines:

#if __GNUC_MINOR__ >= 91 || __GNUC_MINOR__ == 9
#define HAS_Cplusplus_Namespace
#define HAS_Cplusplus_Bool
#endif

This leaves out the new __GNUC_MINOR__ (0) and therefore _CORBA_MODULE ends up
as class instead of namespace.

Please confirm whether I am right, and if I have to append "|| __GNUG__ > 2" to
condition mentioned.
Thank you in advance,

Leandro Fanzone
Compañía HASAR
Buenos Aires
Argentina

Sai-Lai Lo wrote:

> In case you can't wait to use gcc 3.0 to compile omniORB, the following note
> may save you hours of time debugging.
>
> Essentially, the compiler generates wrong code for the ctor of a rather
> complex multiplely inherited class. When the ctor is run, the program SEGV.
> The 'rather complex multiplely inherited class' unfortunately is the POA
> skeleton of a multiplely inherited interface:
>
> interface Echo {
> };
>
> interface DerivedEcho : Echo {
> };
>
> interface MoreEcho {
> };
>
> interface MultiEcho : DerivedEcho, MoreEcho {
> };
>
> Simple single inheritance seems to work. If you have to use multiple
> inheritance in your IDL, you've been warned.
>
> omniORB 3.0 can be compiled with gcc 3.0. The only change necessary is in
> $(top)/src/appl/omniNames/log.cc:
>
> #if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x500
> #define USE_STREAM_OPEN
> #define OPEN(name,mode,perm) open(name,mode,perm)
> #elif defined(__KCC)
> #define USE_STREAM_OPEN
> #define OPEN(name,mode,perm) open(name,mode)
> #elif defined(__GNUG__) && __GNUG__ >= 3              <---
> #define USE_STREAM_OPEN                               <---
> #define OPEN(name,mode,perm) open(name,mode)          <---
> #endif
>
> Sai-Lai
>
> PS. If you are interested in knowing a test case to reproduce the gcc bug,
> see the attached file.
>
>   ------------------------------------------------------------------------
>            Name: t.cc
>    t.cc    Type: unspecified type (application/octet-stream)
>        Encoding: quoted-printable

--------------B4E34EA5FB571AB570AB9B64
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Compiling omniORB 3.0.3 with gcc 3.0, I had a small problem: namespaces
seem not to be defined. I have found at CORBA_sysdep.h:237 the following
lines:
<p><tt>#if __GNUC_MINOR__ >= 91 || __GNUC_MINOR__ == 9</tt>
<br><tt>#define HAS_Cplusplus_Namespace</tt>
<br><tt>#define HAS_Cplusplus_Bool</tt>
<br><tt>#endif</tt>
<p>This leaves out the new <tt>__GNUC_MINOR__</tt> (0) and therefore <tt>_CORBA_MODULE</tt>
ends up as <tt>class</tt> instead of <tt>namespace</tt>.
<p>Please confirm whether I am right, and if I have to append "<tt>|| __GNUG__
> 2</tt>" to condition mentioned.
<br>Thank you in advance,
<p>Leandro Fanzone
<br>Compa&ntilde;&iacute;a HASAR
<br>Buenos Aires
<br>Argentina
<p>Sai-Lai Lo wrote:
<blockquote TYPE=CITE>In case you can't wait to use gcc 3.0 to compile
omniORB, the following note
<br>may save you hours of time debugging.
<p>Essentially, the compiler generates wrong code for the ctor of a rather
<br>complex multiplely inherited class. When the ctor is run, the program
SEGV.
<br>The 'rather complex multiplely inherited class' unfortunately is the
POA
<br>skeleton of a multiplely inherited interface:
<p>interface Echo {
<br>};
<p>interface DerivedEcho : Echo {
<br>};
<p>interface MoreEcho {
<br>};
<p>interface MultiEcho : DerivedEcho, MoreEcho {
<br>};
<p>Simple single inheritance seems to work. If you have to use multiple
<br>inheritance in your IDL, you've been warned.
<p>omniORB 3.0 can be compiled with gcc 3.0. The only change necessary
is in
<br>$(top)/src/appl/omniNames/log.cc:
<p>#if defined(__SUNPRO_CC) &amp;&amp; __SUNPRO_CC >= 0x500
<br>#define USE_STREAM_OPEN
<br>#define OPEN(name,mode,perm) open(name,mode,perm)
<br>#elif defined(__KCC)
<br>#define USE_STREAM_OPEN
<br>#define OPEN(name,mode,perm) open(name,mode)
<br>#elif defined(__GNUG__) &amp;&amp; __GNUG__ >= 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;---
<br>#define USE_STREAM_OPEN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;---
<br>#define OPEN(name,mode,perm) open(name,mode)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;---
<br>#endif
<p>Sai-Lai
<p>PS. If you are interested in knowing a test case to reproduce the gcc
bug,
<br>see the attached file.
<p>&nbsp; ------------------------------------------------------------------------
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Name:
t.cc
<br>&nbsp;&nbsp; t.cc&nbsp;&nbsp;&nbsp; Type: unspecified type (application/octet-stream)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Encoding: quoted-printable</blockquote>
</html>

--------------B4E34EA5FB571AB570AB9B64--