This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ ABI: Mangling of call_expr


On Tuesday, June 24, 2003, at 08:16 AM, Mark Mitchell wrote:

On Tue, 2003-06-24 at 03:32, Nathan Sidwell wrote:
Giovanni Bajo wrote:
Hello,

I can't understand how mangle.c is supposed to mangle a call expression.
Currently, it just segfaults on it. The expression production from the ABI
says:


<expression> ::= <unary operator-name> <expression>
            ::= <binary operator-name> <expression> <expression>
            ::= <trinary operator-name> <expression> <expression>
<expression>
[...]

But what is a CALL_EXPR? Its two-letter mangled name is "cl", but it
certainly can't be either unary, binary, or trinary. In fact, in
operators.def, it is defined with arity "-1", which means "any arity is
allowed". But then, I can't see which production is supposed to use.
looks like a bug in the ABI spec. To be demanglable, there must be a count
of the number of parameters encoded.


Mark, have I missed something?

Only that this is a known issue, with no known solution.


Steve Adamczyk and I agreed at one point that the ISO C++ standard
allows far too much complexity in expressions in this context:

S<sizeof (new (p) X(3.2, a->b (c)))>

is pretty goofy.

However, the standard does presently seem to allow that.

I was pretty sure I had raised this issue on the ABI mailing list, but I
don't see that message, so maybe I never did.

The real question is whether you or Steve has raised this issue on the C++ committee's mailing list. I agree with both of you that arbitrarily complicated expressions like this are ghastly. (Not that I have a good suggestion of exactly where to draw the line between expressions that should be allowed and ones that shouldn't.)

--Matt


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]