[cxx-abi-dev] RE: [cxx-abi] [cxx-abi-dev] Mangling unary plus

Andreas Hommel hommel at metrowerks.com
Thu Oct 10 10:13:15 UTC 2002


Mark Mitchell at mark at codesourcery.com wrote:

> --On Wednesday, October 09, 2002 01:55:16 PM -0700 "Nelson, Clark"
> <clark.nelson at intel.com> wrote:
> 
>>> So, I do not think we have a choice; I think we need to specify "ps"
>>> for unary plus.
>>> 
>>> Thoughts?
>> 
>> There is at least one obvious alternative to consider: is it really
>> necessary to encode unary plus as part of an expression? Can someone give
>> an example where simply ignoring the unary plus would cause a problem?
> 
> First, note that not encoding unary plus at all would require changing
> all of the compilers, so it's not better than going with either "pl"
> or "ps" from that perspective.
> 
> Unary plus does cause integral promotions, for example, so:
> 
> +'a'
> 
> has type "int", not type "char".
> 
> Also, inside a sizeof-expression, unary plus might indicate an
> overloaded operator.

FWIW, the Metrowerks Codewarrior compiler for MacOS X is also using "ps" to
encode the unary plus operator.

Andreas
______________________________________________________________________
Andreas Hommel                        internet:  hommel at metrowerks.com
Senior C/C++ Compiler Architect         Metrowerks, A Motorola Company





More information about the cxx-abi-dev mailing list