473,799 Members | 2,950 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

name decoration

hi all,

what is the rule for decorating a symbol in c++?
Jul 22 '05 #1
8 2583
Bern posted:
hi all,

what is the rule for decorating a symbol in c++?

It's implementation-specific. For instance, there's a
certain way of doing it on Win32. It's commonly referred to
as "name mangling".

-JKop
Jul 22 '05 #2
Bern wrote:
what is the rule for decorating a symbol in c++?


That rule, if any, is implementation specific. I assume you are talking
about name mangling.

Do you have an outer problem, or did you just hear the term "name
decoration" somewhere.

What happens is translation unit A compiles, and its function Foo() turns
into fryingpan_Foo() . Translation unit B compiles extern void Foo(), and its
object file contains a link out to fryingpan_Foo() . The only relevant thing
is the two decorations match; the decorations' contents are irrelevant.

Your compiler author might also write a code browser that reverses the
decoration into its component types.

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces
Jul 22 '05 #3
JKop wrote:

Bern posted:
hi all,

what is the rule for decorating a symbol in c++?

It's implementation-specific. For instance, there's a
certain way of doing it on Win32. It's commonly referred to
as "name mangling".


Each compiler, Win32 or otherwise, has its own way of doing name
mangling. Some even call it by a different name, i.e. "name decoration."

--

Pete Becker
Dinkumware, Ltd. (http://www.dinkumware.com)
Jul 22 '05 #4
is the name decoration for C compilers standardised?
"Phlip" <ph*******@yaho o.com> wrote in message
news:DZ******** *****@newssvr15 .news.prodigy.c om...
Bern wrote:
what is the rule for decorating a symbol in c++?
That rule, if any, is implementation specific. I assume you are talking
about name mangling.

Do you have an outer problem, or did you just hear the term "name
decoration" somewhere.

What happens is translation unit A compiles, and its function Foo() turns
into fryingpan_Foo() . Translation unit B compiles extern void Foo(), and

its object file contains a link out to fryingpan_Foo() . The only relevant thing is the two decorations match; the decorations' contents are irrelevant.

Your compiler author might also write a code browser that reverses the
decoration into its component types.

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces

Jul 22 '05 #5
Please don't top-post. Rearranged.

Bern wrote:
Your compiler author might also write a code browser that reverses
the decoration into its component types.


is the name decoration for C compilers standardised?


No. Most of them don't have any AFAIK, because all the C++ language
features that would need it, like classes, namespaces, templates and
function overloading) aren't available in C.

Jul 22 '05 #6
Bern wrote:

is the name decoration for C compilers standardised?


Most C compiler stick an underscore in front of the names of identifiers
that are defined in user code. But that's not standardized. Neither is
name mangling for C++ compilers.

--

Pete Becker
Dinkumware, Ltd. (http://www.dinkumware.com)
Jul 22 '05 #7
On Sun, 8 Aug 2004 22:32:14 +0800 in comp.lang.c++, " Bern" <x@x.com>
wrote,
hi all,

what is the rule for decorating a symbol in c++?


This issue is covered in Marshall Cline's C++ FAQ. See the topic
"[37.9] If name mangling was standardized, could I link code compiled
with compilers from different compiler vendors?" It is always good to
check the FAQ before posting. You can get the FAQ at:
http://www.parashift.com/c++-faq-lite/
Jul 22 '05 #8

"Rolf Magnus" <ra******@t-online.de> wrote in message news:cf******** *****@news.t-online.com...
No. Most of them don't have any AFAIK, because all the C++ language
features that would need it, like classes, namespaces, templates and
function overloading) aren't available in C.

In actuality, trivial decoration IS added in most C compilers. Global C
symbols get underscores prepended to them to avoid collision with other
runtime symbols (mostly historical).

Jul 22 '05 #9

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

Similar topics

0
1187
by: Sean Ross | last post by:
Set, Mark, and Apply Decoration Provide a means to set the decoration that will be applied to all marked functions (and maybe classes) within a scope (module, class, or function). For example purposes, I will use a decor object that would presumably be made available in each scope (via locals, perhaps). I'll say that it has (atleast) a method set() with the following signature:
15
2135
by: middletree | last post by:
How do I request the actual page name that I'm on? This is going to go into an include file, and depending on which page I'm on, I'd like to do different things. I'm looking for "pagename.asp"
14
6375
by: Andrew Tang | last post by:
Hi, I need some help with understanding this piece of css. <u>This is a <a href="#" style="text-decoration:none;">hyperlink</a> with surrounding underlining</u> From what I understand of css, the styling in <a> should override its parent. But it doesnt seem to work in this case, the whole sentence is still underlined even though I have specifically specified no text-decoration. I'm not saying its wrong but I really cant get my head...
3
4506
by: Christian Roth | last post by:
What I want: <p style="text-decoration: line-through"> Stricken <span style="text-decoration: none">not stricken</span> </p> , where "Stricken " should be the only thing that is lined through. According to CSS2.1, this does not work (and all browsers I tested draw
6
14969
by: Big Bill | last post by:
Doesn't seem to work as I still get an underline. Is there a reason for this? Is this normal? You can see examples on my site. BB -- www.kruse.co.uk/ seo@kruse.demon.co.uk seo that watches the river flow... --
2
7547
by: chandy | last post by:
Hi, I am trying to access the text-decoration property for an element's style. I know that this works: Object.style.color = 'blue'; but this doesn't:
8
2355
by: mastermagrath | last post by:
Hi, I'm about half way through Bruce Eckels thinking in C++ Vol 1. He gives a very short example of how compiler function name decoration helps remove subtle bugs by type-safe linkage. However, upon looking at the example i understand why it fails to link but don't understand why it even compiles. Here's the code, which split between 2 files Def.cpp and Use.cpp: //File Def.cpp
2
7068
by: GloStix | last post by:
For some reason, FF likes to put a black underline on all my buttons. No matter what I do, it has the line I've tried displaying as block and cursor, anything.. Also I've been trying to get it so the entire block is clickable, not just the text. I've sorta got it so it's clickable, just some parts of the button I still can't click on. The website is http://pdhtdev.johnabbott.qc.ca/students/2010/james_mann/portfolio/index.htm The css...
1
8263
by: vineetbindal | last post by:
Hi All, I am new to silverlight and i am following a tutorial. In order to connect to database in silverlight application i need to add a referance to a service. which gives me an error that the contract is not found. I had installed the iis after .net framework 3.5 but i have followed and done all the instructions given at microsoft's website. please help me.
0
9686
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
10475
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
10250
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...
0
10026
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
9068
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
6805
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4139
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 we have to send another system
2
3757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
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.