[C++-sig] Re: todo.txt "Implement type_info streaming for GCC"

Raoul Gough RaoulGough at yahoo.co.uk
Fri Jul 11 19:42:15 CEST 2003

David Abrahams <dave at boost-consulting.com> writes:

> Raoul Gough <RaoulGough at yahoo.co.uk> writes:
>> The source to the demangler is GPL'd, of course (in
>> gcc/libiberty/cp-demangle.c) and is also including in gdb, AFAIK. It's
>> currently >3000 lines of code, so I wouldn't recommend trying to
>> reimplement it for Boost.Python!
> Well, that might just be because it's bad code or written in C with
> insufficient abstraction.  From
> http://mail.python.org/pipermail/c++-sig/2002-June/001277.html it
> doesn't look all that hard.
> (famous last words).

I once tried to look into cp-demangle.c with the naive aim of fixing a
bug I'd found (ha! poor demented fool that I was) but quickly put it
in my too hard basket. I hadn't heard of the __cxa_demangle routine
before (thanks to Adam Hupp for the info). It seems to add about 20kB
of code to an executable (on i386, mingw) which is not bad in the
context of Boost.Python. What about backwards compatability, if the
demangle routine is only available in >=3.1 gcc? c++filt (AFAIK) has
always been available as a command-line tool.

Raoul Gough
"Let there be one measure for wine throughout our kingdom, and one
measure for ale, and one measure for corn" - Magna Carta

More information about the Cplusplus-sig mailing list