Jump to content
  • Advertisement
  • entries
    1212
  • comments
    1738
  • views
    1144368

Too much mangling!

Sign in to follow this  
johnhattan

67 views

Since playing with the STL, I've discovered a fun new game called "fun with C++ name-mangling".

I embedded an STL component within an STL component today, using the standard allocators. It was a simple array of strings. . .

vector Args;

By the time Visual C++ was done with it, Args was of the type. . .

??0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$__default_alloc

_template@$0A@$0A@@2@@std@@V?$__default_alloc_template@$0A@$0A@@2@@st

d@@QAE@IABV?$basic_string@DU?$char_traits@D@std@@V?$__default_alloc_t

emplate@$0A@$0A@@2@@1@ABV?$__default_alloc_template@$0A@$0A@@1@@Z

Such is the price we pay for type-safety. Actually, Visual C++ does a great job of hiding C++ mangled names. Unfortunately, the mangled name bumped into the 256-character limit of declarations, so it started throwing up warnings about it.

Way back when, at the early days of Tandy, we had to learn to decipher mangled names. Early C++ compilers and debuggers did a pretty poor job of putting mangled names back into C++ format. Of course, things were much simpler, then. Nested classes were about the worst you could expect.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!