473,503 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What gcc 2.95 declaration yields mangled name __ls__7ostreamPFR7ostream_R7ostream

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::operator <<(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.

Oct 17 '06 #1
2 1679
toduro wrote:
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.
Oct 17 '06 #2
toduro wrote:
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::operator <<(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::operator<<(ostream &(*)(ostream &))
[/OT]

--
Clark S. Cox III
cl*******@gmail.com
Oct 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2817
by: Johnny Lee | last post by:
Hi, I'm new in python and I was wondering what's the difference between the two code section below: (I) class TestResult: _pass_ = "pass" _fail_ = "fail" _exception_ = "exception"
10
2330
by: Sune | last post by:
Hi, previously I used Eclipse CDT for compiling my files just to get started with C and leave C++ behind. Now it's time to get a little more serious so I've moved my files to a new workplace and...
4
1720
by: Randy | last post by:
Compiling the following code #include <iostream> #include "cenum.h" using namespace std; class Test { CEnum MyCars("CAR", "Mustang, Nova, Pinto, Barracuda");
0
1101
by: seek help | last post by:
Hello, IDE: VS .NET 2003. Problem: Mangled bits of gc class embedded within native C++ class. Description: I have a gc class, BoxedInfo. This wraps a Value type structure, NotiInfo....
2
2415
by: Chavoux | last post by:
Hi When I try to compile the following code I get an error: ) { cout << "starting... Creating COMPORT1"; int x = CreatePort("COM1"); } </code> I'm using Dev-C++ (minGW compiler) on Windows...
1
1584
by: toduro | last post by:
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" appeared as...
22
3034
by: nospam_news | last post by:
I currently get asked about my usage of "auto". What is it for? The keyword is clearly superflous here. In contrast to the huge majority of C/C++ developers I write definitions very explicitly...
1
1833
by: ....DotNet4Ever.... | last post by:
I have been noticing declarations like this: private DateTime? _creationdate; and have been wondering what is the function or meaning of that question sign after the member type name. I...
11
3654
by: Neo | last post by:
If i have a : typedef struct str32{ uint32_t word1; uint32_t word2; } word_array; word_array *my_array; what would be the data type of this: myarray->word1
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
5021
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4685
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1519
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
397
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.