Issue 71264 - ooe680-m2 framework fails to compile with gcc 4.2
Summary: ooe680-m2 framework fails to compile with gcc 4.2
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: current
Hardware: All All
: P3 Trivial (vote)
Target Milestone: OOo 2.2
Assignee: bero
QA Contact: issues@framework
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-06 18:20 UTC by bero
Modified: 2007-02-05 13:33 UTC (History)
2 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Fix (6.37 KB, patch)
2006-11-06 20:17 UTC, bero
no flags Details | Diff
Alternative fix - replace sal_Bool with bool (5.80 KB, patch)
2006-11-08 14:14 UTC, bero
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description bero 2006-11-06 18:20:27 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*)

[...]
Comment 1 bero 2006-11-06 20:17:44 UTC
Created attachment 40379 [details]
Fix
Comment 2 Mathias_Bauer 2006-11-07 17:51:41 UTC
Carsten, the patch is for your code
Comment 3 carsten.driesner 2006-11-08 09:55:19 UTC
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?
Comment 4 Stephan Bergmann 2006-11-08 10:02:57 UTC
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.
Comment 5 bero 2006-11-08 12:39:52 UTC
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.
Comment 6 bero 2006-11-08 13:39:26 UTC
Replacing sal_Bool with bool seems to work (full build isn't complete yet, but 
running dmake in framework/source/helper is)
Comment 7 carsten.driesner 2006-11-08 14:08:02 UTC
cd->bero: If your new changes work, please attach them again and I will add the
patch to one of our CWS.
Comment 8 bero 2006-11-08 14:14:39 UTC
Created attachment 40430 [details]
Alternative fix - replace sal_Bool with bool
Comment 9 carsten.driesner 2006-11-08 15:56:55 UTC
cd->bero: Thanks for your 2nd patch.

Accept patch. Added to CWS fwk56, it will be integrated into OOo 2.2.
Comment 10 carsten.driesner 2006-11-09 08:31:52 UTC
cd: Fixed.
Comment 11 carsten.driesner 2006-12-06 08:58:48 UTC
cd: Patch verified.
Comment 12 carsten.driesner 2007-01-09 12:28:41 UTC
cd->bero: Could you please verify that you can build the framework project on
OpenOffice.org SRC680m198 with gcc 4.2.
Comment 13 bero 2007-01-09 15:47:59 UTC
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 ;)
Comment 14 carsten.driesner 2007-01-16 10:30:36 UTC
cd->bero: Changed owner. Please verify and close issue.
Comment 15 Mathias_Bauer 2007-02-05 13:33:28 UTC
closing ancient issues