Hi all,

I tried to send this mail to [email protected] some hours ago. It seems 
that it was not delivered (it is not in the mailing list archive). I do not 
know why. So, I try [email protected] now.

Could you help me to find the right place where to discuss this problem at 
least? :-)


I am fixing OOo to build with the upcoming gcc-4.1. And I got many similar 
build errors like this one:

--- cut ---
/usr/src/packages/BUILD/ooo-build-2.1.137/build/src680-m137/cppuhelper/source/access_control.cxx:65:
   
instantiated from here
/usr/src/packages/BUILD/ooo-build-2.1.137/build/src680-m137/solver/680/unxlngi6.pro/inc/com/sun/star/uno/Any.hxx:240:
 
error: no matching function for call to 
'getCppuType(com::sun::star::uno::Reference<com::sun::star::security::XAccessContr
oller>*)'
../unxlngi6.pro/inc/com/sun/star/uno/Exception.hpp:62: note: candidates are: 
const com::sun::star::uno::Type& getCppuType(const 
com::sun::star::uno::Exception*)
../unxlngi6.pro/inc/com/sun/star/uno/RuntimeException.hpp:44: note:             
    const com::sun::star::uno::Type& getCppuType(const 
com::sun::star::uno::RuntimeException*)
../unxlngi6.pro/inc/com/sun/star/uno/TypeClass.hdl:57: note:                 
const com::sun::star::uno::Type& getCppuType(const 
com::sun::star::uno::TypeClass*)
/usr/src/packages/BUILD/ooo-build-2.1.137/build/src680-m137/solver/680/unxlngi6.
--- cut ---

The problem is the following. Any.hxx defines some inline operators and 
methods that use the function getCppuType. The function getCppuType is 
declared for many types in the .hdl include files and is defined in the 
related .hpp include files. Most of the .hpp files includes Any.hxx. 
Thereafter, Any.hxx is usually included when the first .hpp file is included. 
It means that Any.hxx is included before the other .hpp/.hdl files are 
included. It means that the methods and operators from Any.hxx are defined 
before the related getCppuType functions are even declared.

It worked in the past but gcc-4.1 does not longer allow this situation. I 
discussed it with our gcc developers and they said that the code was broken. 
The function getCppuType must be declared before it is used at least.

The situation is quite complicated. I have already did some research and found 
the following (I searched complete build tree compiled by an older compiler):

    Any.hxx is included from files:
        .hxx: 99
        .hdl: 0
        .hpp: 1183
        .cxx: 229
        total: 1511

    .hdl files included from files:
        .hxx: 26
        .hdl: 6102
        .hpp: 8100
        .cxx: 127
        total: 14355

    .hpp files included from files:
        .h:   35
        .hxx: 3177
        .hdl: 0
        .hpp: 8224
        .cc:  3
        .cpp: 1395
        .cxx: 3693
        total: 16527

    .hpp files included from these files in solver (this would point to a 
cross-module and more complicated dependencies):
        .h:   2
        .hxx: 264
        .hdl: 0
        .hpp: 2181
        .cxx: 1
        total: 2448


One solution would be to remove #include Any.hxx from all .hpp files and 
include it after all the .hpp files are included. It won't be easy, see the 
numbers above. I have not found a better solution though yet.

One big problem would be if the methods or functions defined in Any.hxx are 
used in a .hpp file. I hope that it does not happen.



I thought about other solutions but they seem to be unusable:

For example, I tried to declare all the getCppuType functions in Any.hxx. It 
is ugly because this declaration conflits with the declaration in the 
related .hdl file. It is a nasty hack in each case. In addition, there is a 
problem that many other types and namespaces must be declared as well.

Another attempt was to include all .hdl files in Any.hxx. It is very ugly. It 
means to include some hundreds of files. In addition, all the .hdl files are 
not available every time, they are defined in more modules, ... Finally, 
there are some conflicts in declarations. These conflicts do not appear if 
the conflicting declaration is not included now. So, it would require some 
more fixes to avoid such conflicts, ...

I has not found any other reasonable solution yet.


What do you think?

Is there a better solution?


Add me to CC because I am not on this list, please.

We could discuss it on irc if you prefere this way. I am often on the channel 
#openoffice.org, nick pmladek.

Thanks in advance.

-- 
Best Regards,

Petr Mladek
software developer
---------------------------------------------------------------------  
SuSE CR, s.r.o.                             e-mail: [EMAIL PROTECTED]
Drahobejlova 27                             tel:+420 296 542 373 
190 00 Praha 9                              fax:+420 296 542 374   
Czech Republic                              http://www.suse.cz/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to