Apache OpenOffice (AOO) Bugzilla – Issue 71264
ooe680-m2 framework fails to compile with gcc 4.2
Last modified: 2007-02-05 13:33:28 UTC
/usr/src/ark/BUILD/ooo-build/build/ooe680-m2/solver/680/unxlngi6.pro/inc/cppu/unotype.hxx: In static member function 'static const com::sun::star::uno::Type& cppu::UnoType< <template-parameter-1-1> >::get() [with T = unsigned char:1]': /usr/src/ark/BUILD/ooo-build/build/ooe680-m2/solver/680/unxlngi6.pro/inc/cppu/unotype.hxx:309: instantiated from 'const com::sun::star::uno::Type& cppu::getTypeFavourUnsigned(const T*) [with T = unsigned char:1]' /usr/src/ark/BUILD/ooo-build/build/ooe680-m2/solver/680/unxlngi6.pro/inc/com/sun/star/uno/Any.hxx:206: instantiated from 'com::sun::star::uno::Any com::sun::star::uno::makeAny(const C&) [with C = unsigned char:1]' /usr/src/ark/BUILD/ooo-build/build/ooe680-m2/framework/source/helper/uiconfigelementwrapperbase.cxx:259: instantiated from here /usr/src/ark/BUILD/ooo-build/build/ooe680-m2/solver/680/unxlngi6.pro/inc/cppu/unotype.hxx:288: error: no matching function for call to 'cppu_detail_getUnoType(unsigned char:1*)' /usr/src/ark/BUILD/ooo-build/build/ooe680-m2/solver/680/unxlngi6.pro/inc/cppu/unotype.hxx:144: note: candidates are: const com::sun::star::uno::Type& cppu::detail::cppu_detail_getUnoType(const cppu::UnoVoidType*) /usr/src/ark/BUILD/ooo-build/build/ooe680-m2/solver/680/unxlngi6.pro/inc/cppu/unotype.hxx:149: note: const com::sun::star::uno::Type& cppu::detail::cppu_detail_getUnoType(const bool*) [...]
Created attachment 40379 [details] Fix
Carsten, the patch is for your code
cd->bero: Hi bero, thanks for your patch. We have some concerns about your changes as you use hard casts. As you can read in our warning free code effort, we discourage from using hard cast (http://wiki.services.openoffice.org/wiki/Writing_warning-free_code). You should at least use the proposed sal::static_int_cast<sal_Bool> to solve the gcc 4.2 problems. I discussed it with sb (who currently maintains the warning free code effort) and we agreed that the best solution would be to change the declarations of the boolean members. Our propose solution would be to use bool instead of sal_Bool abc : 1. UNO already supports bool so there shouldn't be any problem. What do you think?
It is unclear to me whether bool foo: 1; makeAny(foo); instead of sal_Bool foo: 1; makeAny(foo); would compile without warning on GCC 4.2 (and I do not have a GCC 4.2 handy). Bero, could you please check whether it would work? Thanks.
Will do, but it'll take a couple of hours (I'm on a rather slow box). One clarification right now: What gcc 4.2 produces is not a warning, but an error -- it can't be convinced to compile the original code.
Replacing sal_Bool with bool seems to work (full build isn't complete yet, but running dmake in framework/source/helper is)
cd->bero: If your new changes work, please attach them again and I will add the patch to one of our CWS.
Created attachment 40430 [details] Alternative fix - replace sal_Bool with bool
cd->bero: Thanks for your 2nd patch. Accept patch. Added to CWS fwk56, it will be integrated into OOo 2.2.
cd: Fixed.
cd: Patch verified.
cd->bero: Could you please verify that you can build the framework project on OpenOffice.org SRC680m198 with gcc 4.2.
Will do when I get back home some time next week -- I'm currently visiting my parents, and downloading OOo over pay-per-minute dialup is painful ;)
cd->bero: Changed owner. Please verify and close issue.
closing ancient issues