🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Too much mangling!

Published February 24, 1999
Advertisement
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.



0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement