Apache OpenOffice (AOO) Bugzilla – Issue 18776
attempts to assign non-enum val to enum cause compilation failure
Last modified: 2004-02-07 07:04:02 UTC
At the tail of the function static UChar32 _LMBCSGetNextUCharWorker(UConverterToUnicodeArgs* args, UErrorCode* err, UBool returnUTF32) located in icu's misc/build/icu/source/common/ucnv_lmb.c an attempt is made to assign *err = ULMBCS_MULTI which is effectively U_ERROR_LIMIT + 1 which is beyond the range of the UErrorCode enumeration. I would have provided a patch but am unsure of the desired solution. I would suggest not using enumerated values if there is intent to perform math on those values.
confirmed
Hi Tyler, I simply consider this bad programming style and it looks like someone was too lazy to declare a proper UErrorCode enum value for this (and not putting a #define value in parentheses is bad style anyways). Again, please file an ICU bug at http://www.jtcsv.com/cgi-bin/icu-bugs Please mention this OOo issue number there, and provide a reference to the ICU bug here. Thanks. As a workaround I suggest to simply cast the result to an UErrorCode again (*err = (UErrorCode)(ULMBCS_MULTI)).
due to eike's comment I set this issue to fixed, please feel free to reopen, if this does not work for you.
mark as verified.
close issue, feel free to reopen if there is a problem left.
close issue.