This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Mangle question


> Date: Mon, 28 Aug 2000 17:12:52 +0200
> From: Carlo Wood <carlo@alinoe.com>
> To: gcc@gcc.gnu.org

> I noticed that when in a mangled name a 'T' is used with an index
> larger than 9, it is appended an underscore.  This seems to make no
> sense.  Why is this done?

Makes sense to me, but that's maybe because I'm the one that thought
it up.  :-) See, back a long time ago, there was a problem handling
more than about 9 somethings.  And the mangling format, was a single
decimal digit indicating how many of them there were.  The compiler
generated them this way and the demangler and friends ate just one
digit.  Then a customer had a testcase with 12 or so of them.  By have
it done this way, we preserve backward and forwards compatibility for
99% of the code (<10 of something), and by having _[0-9]+/[^0-9] for
the new case, we then can have any number (literally) of somethings
going forward.

If the code wasn't broken from the start and if compatibility wasn't a
concern, there'd be no need to do this.

Hope you liked the story...

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]