Apache OpenOffice (AOO) Bugzilla – Issue 53950
cppumaker: encode UNOIDL identifiers that are C++ keywords
Last modified: 2017-05-20 11:31:43 UTC
offapi/com/sun/star/drawing/CaptionEscapeDirection.idl 1.4 contains const short auto = 2; which is translated by cppumaker to the syntax error static const ::sal_Int16 auto = (sal_Int16)2; As discussed in the thread starting at <http://udk.openoffice.org/servlets/ReadMsg?list=dev&msgNo=2389>, it is a compatible change to fix the use of any C++ keywords (as of the 1998 C++ Standard) as UNOIDL identifiers by encoding them as <PREFIX>_<ID>. (In retrospect, I think mapping an <ID> that names a UNOIDL const to "constant_<ID>" instead of "const_<ID>" to avoid clashes with the C++ keyword "const_cast" is not necessary, as "cast" itself is not a C++ keyword. This rule should thus be changed.) (Java has a similar problem; however, only changing Java 1.3 keywords would be a compatible change---keywords added by later revisions are problematic.)
change target
Attaching the trivial patch to fix this. Assuming offuh contains all the IDL - a diff -u of the generated headers before/after contains only: diff -u -r unxlngi6.pro/inc/com/sun/star/drawing/CaptionEscapeDirection.hdl unxlngi6.pro.new/inc/com/sun/star/drawing/CaptionEscapeDirection.hdl --- unxlngi6.pro/inc/com/sun/star/drawing/CaptionEscapeDirection.hdl 2006-03-13 11:32:10.000000000 +0000 +++ unxlngi6.pro.new/inc/com/sun/star/drawing/CaptionEscapeDirection.hdl 2006-03-13 11:29:42.000000000 +0000 @@ -16,7 +16,7 @@ static const ::sal_Int16 horizontal = (sal_Int16)0; static const ::sal_Int16 vertical = (sal_Int16)1; -static const ::sal_Int16 auto = (sal_Int16)2; +static const ::sal_Int16 const_auto = (sal_Int16)2; } } } } } So this should be safe - I'm also assuming that no valid/compiling C++ code can have ever used this & => not re-compile tested everything to check. Doesn't really merit it's own cws - can someone put it in theirs ? Stefan ? HTH.
Created attachment 34814 [details] patch.
@mmeeks: Your first attempt (UNOIDL auto -> const_auto) does not work, as it incompatibly changes data that is not only used by C++. Your second attempt (cppumaker auto -> const_auto) does not work, as it incompatibly changes things that currently work if certain requirements are met (e.g., USHRT_MAX is not extended to const_USHRT_MAX, which is ok as long as the translation unit does not include limits.h).
Sorry Michael, but your patch is to simple and doesn't solve the problem in general. The issue was already addressed and will be fixed completely.
accepted
change target to 2.0.4 because of time schedule
adapt target
set target to 3.x according to http://wiki.services.openoffice.org/wiki/Target_3x
Reset assigne to the default "issues@openoffice.apache.org".