[omniORB] Build Problem on HPUX 11.00 with aCC(A.03.25)

Masaaki Sekiya sekiya@nagoya.ydc.co.jp
Thu, 14 Sep 2000 20:31:11 +0900 (JST)


Hello, omniORBers.

I get compile Error and Warnings with HP aCC (B3910B A.03.25).
To remove it , I apply patches to some files.

My question is:
Are there something wrong in these patches ?
Is it possible to apply these ( or some of ) patches to external omniORB3.0.1 ?

* Error caused by compiler bug (maybe)

I have used omniORB_3.0.1 with HP aCC which version is as below.

/usr/bin/aCC:
        HP aC++ B3910B A.03.13
        HP aC++ B3910B X.03.11.10 Language Support Library

Then, I changed aCC version to as below.

/usr/bin/aCC:
        HP aC++ B3910B A.03.25
        HP aC++ B3910B X.03.14.12 Language Support Library

=============
aCC -c -O -w +inst_v +DAportable -D_THREAD_SAFE -DRWSTD_MULTI_THREAD -DRW_MULTI_
THREAD  -DIDLMODULE_VERSION="\"0x2301\"" -I/usr/local/python/include +Z -I.  -I.
./../../../include -D__hppa__ -D__hpux__ -D__OSVERSION__=11 -ldir y.tab.cc -o y.
tab.o
Error 439: Exact position unknown; near ["./idlscope.h", line 244]. # Name 'Kind
' was redefined after its use in a class. A previous declaration used "enum Scop
e::Kind" ["./idlscope.h", line 119].
=============
This error is issued before ,
http://www.uk.research.att.com/omniORB/archives/2000-09/0022.html

As Paul wrote , it looks like a compiler bug , which is related with 
scope-identifier collision.
To solve it, patch like below may be necessary.
( change enum Kind to oter name )

% diff idlscope.h
244c244
<     enum EKind {
---
>     enum Kind {
254c254
<     Entry(const Scope* container, EKind kind, const char* identifier,
---
>     Entry(const Scope* container, Kind kind, const char* identifier,
261c261
<     EKind              kind()       const { return kind_; }
---
>     Kind              kind()       const { return kind_; }
279c279
<     EKind              kind_;
---
>     Kind              kind_;
% diff idlscope.cc
216c216
< Entry(const Scope* container, EKind k, const char* identifier,
---
> Entry(const Scope* container, Kind k, const char* identifier,

( To change place of a declaration of enum also may solve error )

And I want to remove some warnings. 

* omkdepend cannot open "+Z" 
=============
../../../../bin/hppa_hpux_11.00/omkdepend -D__cplusplus -DIDLMODULE_VERSION="0x2
301" -I/usr/local/python/include +Z -I. -I../../../../include -D__hppa__ -D__hpu
x__ -D__OSVERSION__=11 idlc.cc idlpython.cc idlconfig.cc idldump.cc idlvalidate.
cc idlast.cc idlexpr.cc idlscope.cc idlrepoId.cc idltype.cc idlutil.cc idlerr.cc
 lex.yy.cc y.tab.cc
../../../../bin/hppa_hpux_11.00/omkdepend: warning:  cannot open "+Z"
=============
This warning may come from omkdepend bug.
Patch for main.c may be necessary.

%diff main.c
212c212
<                       if (endmarker && **argv == '+')
---
>                       if (endmarker || **argv == '+')

In order to check strictly, 
I add complile option "+w" to CXXOPTIONS in hppa_hpux_11.00.mk.
Then I get some future error and suggestion from compiler.

* future Error because of union without name
=============
Error (future) 254: "./typecode.h", line 158 # Anonymous unions may only contain
 non-static data members and not define types.
=============
To remove it, I add name of unions.

* explicit private
=============
Warning (suggestion) 555: "dynAnyNil.cc", line 206 # Access type should be speci
fied in the base class list; the default is private.
=============
To remove it , I add 'private' word.

* casting 'sockaddr_in *' -> 'struct sockaddr *'
This warning appears in 'tcpSocketMTfactory.cc'
To remove it, I apply patche using 'reinterpret_cast' as below.

< (struct sockaddr *)&raddr 
---
> reinterpret_cast<sockaddr*>(&raddr)

And next two cast looks internal matter.
So I can't see weather a patch just using 'reinterpret_cast' is enough or not.

* casting 'omniOrbPOAManager *' -> 'CORBA::Object_ptr'/'PortableServer::POA_ptr'
=============
Warning 749: "poamanager.cc", line 294 # The cast from 'omniOrbPOAManager *' to
PortableServer::POA *' is performed as a 'reinterpret_cast'. This operation is
non-portable and potentially unsafe.
        return (PortableServer::POA_ptr) this;
=============

* casting 'CORBA::TypeCode_ptr' -> 'TypeCode_base *'
=============
Warning 749: "../poamanager.cc", line 294 # The cast from 'omniOrbPOAManager *'
to 'PortableServer::POA *' is performed as a 'reinterpret_cast'. This operation
is non-portable and potentially unsafe.
        return (PortableServer::POA_ptr) this;
=============

Thanks in advance.

Masaaki Sekiya (YDC)