473,811 Members | 4,047 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C++0x on name mangling.

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
Feb 29 '08 #1
4 1974
On Feb 29, 3:44 am, "jason.cipri... @gmail.com"
<jason.cipri... @gmail.comwrote :
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.)

--
James Kanze (GABI Software) email:ja******* **@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Feb 29 '08 #2
What is name mangling ? No idea what u talking here ?

Thanks for your explanation
Feb 29 '08 #3
On Fri, 29 Feb 2008 02:31:29 -0800, PeterAPIIT wrote:
What is name mangling ? No idea what u talking here ?
http://en.wikipedia.org/wiki/Name_mangling

--
Lionel B
Feb 29 '08 #4
On Feb 29, 4:31 am, James Kanze <james.ka...@gm ail.comwrote:
[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@@YAX H@Z
00000007 T ?ffunction@@YIX H@Z
00000000 T ?sfunction@@YGX H@Z

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

Thanks,
Jason
Feb 29 '08 #5

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

Similar topics

5
2018
by: Steven Bethard | last post by:
Philippe C. Martin wrote: > class Debug_Stderr: > __m_text = '' > __m_log_text = None > __m_dbg = None > __m_refresh_count = 0 <rant> I don't see the benefit in 99.9% of cases for making class variables
4
1890
by: sunny | last post by:
Hi, I was trying to call a function in an an asm file from a C file(driver). In c file the funcrtion is defined as: extern int foo(int,int); In the asm file the function is defined as _foo. when I link the 2 binaries in VC++ it works fine but with DDK this gives as error saying _foo@8 not found.
1
2526
by: Tim Slattery | last post by:
Does the C++ language standard mandate a particular name-mangling method? I'm trying to use the Entrust toolkit to create a C++ program that encrypts and decrypts files. Entrust supplies header files defining their objects and functions, and *.so files (I'm on a Sun Sparc machine running Solaris) containing the implementation of the functions. I'm compiling with the GNU g++ compiler. According to the
6
6529
by: yyy | last post by:
my question is rather theoretical than practical in the pure programming aspect... is "name mangling" the same as "name decorating" ? browsing the web, you might find multiple people saying "yes", but i vaguely remember having read that it's not exactly like that one might say that "name mangling" is a part of c++ compiler specification and is a naming scheme to support function overloading
1
1910
by: noleander | last post by:
I need to use a library supplied by someone else: libjpeg.lib. This is a plain C library. I do not have the source code. I do have the header *.h files. When I run dumpbin on the libjpeg.lib, it contains symbols (entry points) like: jpeg_read_header I'm trying to link my program with this library. My program is in Visual C++. The link fails with link-time errors such as:
6
1721
by: David Wade | last post by:
Folks, Does any one know of any "name mangling" software that allows standard C with long names to be linked? Any suggestions for a better place to look? I have tried putting various searchs into google to no avail. Dave.
5
1967
by: Subhransu Sahoo | last post by:
Hi All, Does the C++ standard tell function overloading can't be done with the return types of two functions ? If so, is it true that the name mangling scheme does not take the return type into account ?I know that C++ standard does not tell anything about name mangling and only talks bout function overloading. But, I have observed that the Metrowerks Code Warrior compiler does take return type into the mangling scheme. Is it not a bug...
8
3141
by: sam_cit | last post by:
Hi Everyone, I read somwhere that c++ compiler does name mangling of functions which is why c source code can't invoke functions from object files that were generated using c++ compiler. Can anyone tell in detail as to what name mangling is all about?
14
3002
by: Megalo | last post by:
why not make "name mangling" of C++ standard so should be possible to call the classes and the functions of C++ from other C++ compiler thanks
0
9724
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10644
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10394
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10127
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9201
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5552
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.