Apache OpenOffice (AOO) Bugzilla – Issue 13084
Remove 5400 warnings for MSVC
Last modified: 2003-04-10 13:05:28 UTC
Branch cws_srx644_ooo20030412 The following patch for sal/inc/rtl/ustring.hxx adds a "0!=" as a type of cast in front of rtl_convertUStringToString(..) leading to: return 0!=rtl_convertUStringToString The expected return value is bool, but rtl_convertUStringToString is sal_Bool (= unsigned char). Without the "cast" this leads to 5444 warnings of the following kind: e:\w1\cws_srx644_ooo20030412cyg\solver\644\wntmsci7.pro\inc\rtl/ustring.hxx(1093) : warning C4800: 'unsigned char' : forcing value to bool 'true' or 'false' (performance warning) A simple (bool) cast doesn't help against this warning, Microsoft recomends the use of !=0. Is this OK for other Systems or do we need a special macro for this. E.g. #ifdef _MSC_VER define BOOL_CAST 0!= #else define BOOL_CAST (bool) #endif in sal/inc/sal/config.h
Created attachment 5484 [details] Patch for sal/inc/rtl/ustring.hxx
Oops, s/define/#define/g
mh->sb: please review !
This has already been fixed, not by massaging ("uglyfying") the source code, but rather by turning this specific MSVC warning off. We had a discussion about it (I think it was only inhouse), and agreed that this warning is rather useless (it should be obvious that, in general, changing from one representation---in this case sal_Bool resp. char---to another---in this case bool---requires some sort of conversion; no warning should be given here---there isn't any warning in other cases, either, like changing from long to short or from int to float). Fixed as part of internal bug #107762# (child workspace uno1, integrated in SRX644M7S2), see sal/inc/sal/config.h 1.15.40.1.
reassigned
Resolved.
c