What gcc 2.95 declaration yields mangled name __ls__7ostreamPFR7ostream_R7ostream

T

toduro

Sorry about the bad subject line earlier.

What is the right syntax for a C++ declaration which would give me

__ls__7ostreamPFR7ostream_R7ostream

in an object file produced by the gcc 2.95 compiler?

The name "magically" [that means I have no clue about why or how]
appeared as an undefined reference in an object file whosse
corresponding C++ source has no references at all to ostream after I
made some coding changes to improve performance and then recompiled.

I did a bit of googling and experimentation to find that:

ostream::eek:perator <<(ostream &())

yields

__ls__7ostreamPFv_R7ostream

but I haven't seenhow to get rid of the "v_" in the middle or to get
the "_R7ostream" on the end of the mangled name. What declaaration
will work?

The rules I found from googling say that class names are prepended by
the length of the name, so "7ostream" comes from "ostream", and that
"P" stands for a pointer, "F" stands for a function, and "R" stands for
a reference.
 
R

red floyd

toduro said:
Sorry about the bad subject line earlier.

What is the right syntax for a C++ declaration which would give me

__ls__7ostreamPFR7ostream_R7ostream

in an object file produced by the gcc 2.95 compiler?

Try gnu.g++.help

Name mangling is compiler specific.
 
C

Clark S. Cox III

toduro said:
Sorry about the bad subject line earlier.

What is the right syntax for a C++ declaration which would give me

__ls__7ostreamPFR7ostream_R7ostream

in an object file produced by the gcc 2.95 compiler?

The name "magically" [that means I have no clue about why or how]
appeared as an undefined reference in an object file whosse
corresponding C++ source has no references at all to ostream after I
made some coding changes to improve performance and then recompiled.

I did a bit of googling and experimentation to find that:

ostream::eek:perator <<(ostream &())

yields

__ls__7ostreamPFv_R7ostream

but I haven't seenhow to get rid of the "v_" in the middle or to get
the "_R7ostream" on the end of the mangled name. What declaaration
will work?

The rules I found from googling say that class names are prepended by
the length of the name, so "7ostream" comes from "ostream", and that
"P" stands for a pointer, "F" stands for a function, and "R" stands for
a reference.

This is really off topic here, as the standard doesn't mandate a
particular name mangling implementation (or if there is even any name
mangling).

Ask on a gcc group.

[OT]
The c++filt tool will tell you what you want:

[ccox-macbook:~] ccox% c++filt __ls__7ostreamPFR7ostream_R7ostream
ostream::eek:perator<<(ostream &(*)(ostream &))
[/OT]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top