Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Name mangling
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
====Complex example==== The mangled symbols in this example, in the comments below the respective identifier name, are those produced by the GNU GCC 3.x compilers, according to the [[IA-64]] (Itanium) ABI: <syntaxhighlight lang="cpp"> namespace wikipedia { class article { public: std::string format (); // = _ZN9wikipedia7article6formatEv bool print_to (std::ostream&); // = _ZN9wikipedia7article8print_toERSo class wikilink { public: wikilink (std::string const& name); // = _ZN9wikipedia7article8wikilinkC1ERKSs }; }; } </syntaxhighlight> All mangled symbols begin with {{code|_Z}} (note that an identifier beginning with an underscore followed by a capital letter is a [[reserved identifier]] in C, so conflict with user identifiers is avoided); for nested names (including both namespaces and classes), this is followed by {{code|N}}, then a series of <length, id> pairs (the length being the length of the next identifier), and finally {{code|E}}. For example, {{code|wikipedia::article::format}} becomes: _ZN9wikipedia7article6formatE For functions, this is then followed by the type information; as {{code|format()}} is a {{code|void}} function, this is simply {{code|v}}; hence: _ZN9wikipedia7article6formatEv For {{code|print_to}}, the standard type {{code|std::ostream}} (which is a {{mono|[[typedef]]}} for {{code|std::basic_ostream<char, std::char_traits<char> >}}) is used, which has the special alias {{code|So}}; a reference to this type is therefore {{code|RSo}}, with the complete name for the function being: _ZN9wikipedia7article8print_toERSo
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)