C++0x on name mangling.

J

jason.cipriani

Does anybody know if C++0x is going to change C++ name mangling at
all? Such as, standardizing name mangling instead of leaving it up to
the compiler?

Jason
 
J

James Kanze

Does anybody know if C++0x is going to change C++ name
mangling at all? Such as, standardizing name mangling instead
of leaving it up to the compiler?

C++ does not, and in fact, cannot define implementation details.
There are too many differences at the architecture level to make
this practical.

Specific platforms can, and occasionally do, define a platform
specific C++ API. Regretfully, far too occasionally---there
isn't one for either Solaris/Sparc nor Windows/PC, and as far as
I know, only an ad hoc one for Linux/PC. (All platforms I know
do defined a platform specific API for C.)

And of course, any time the API differs, you want some sort of
differing conventions for name mangling, so that you don't
accidentally link code which won't work together. (I'm not
aware of any case where the API's are identical, but the name
mangling isn't. I would consider the name mangling part of the
API. On the other hand, I wouldn't be surprised if different
languages---e.g. Pascal and C---under Windows mangled the names
in the same way, despite using different calling conventions.
It was, at least, a problem under MS-DOS.)
 
P

PeterAPIIT

What is name mangling ? No idea what u talking here ?

Thanks for your explanation
 
J

jason.cipriani

[all kinds of stuff]

Thanks for the good explanation!
On the other hand, I wouldn't be surprised if different
languages---e.g. Pascal and C---under Windows mangled the names
in the same way, despite using different calling conventions.

FYI, that problem no longer seems to exist:

void __stdcall sfunction (int) { }
void __fastcall ffunction (int) { }
void __cdecl cfunction (int) { }

Ends up with:

00000012 T ?cfunction@@YAXH@Z
00000007 T ?ffunction@@YIXH@Z
00000000 T ?sfunction@@YGXH@Z

Using both MS CL 12.00 (VS 6) and 14.00 (VS 2005).

Thanks,
Jason
 

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,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top