This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: RFC: new __cxa_demangle
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: Benjamin Kosnik <bkoz at redhat dot com>, Martin Sebor <sebor at roguewave dot com>, "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: 24 Feb 2003 11:20:42 +0100
- Subject: Re: RFC: new __cxa_demangle
- Organization: Integrable Solutions
- References: <10230000.1045777843@warlock.codesourcery.com>
Mark Mitchell <mark at codesourcery dot com> writes:
| --On Wednesday, February 19, 2003 06:31:04 PM -0600 Benjamin Kosnik
| <bkoz at redhat dot com> wrote:
|
| >
| >> FWIW, it would be nice to have a demangler that other implementations
| >> of the C++ Standard library could use :)
| >
| > You already do: libiberty/cp-demangle.c. You might want to look at it.
| >
| > Sorry, you have not persuaded me. I'd like to try this new
| > implementation out.
|
| I think it's a mistake to do a new implementation in C++.
I beg to differ.
|
| I think that the demangler should be written in C as an independent
| module so that it can be used in programs that are not written in C++.
| And I think that having two demanglers just makes things worse; now
| they can be out of synch in all sorts of weird ways.
While I recognize of the out-of-sync danger of having two independent
implementations, it is a mistake to force a C implementation of the
demangler on every body. This message is not a religious matter.
The C interface contains plenty of C ways of building interfaces that
just don't catch on and are very inconvenient to work with. C++ can
support foreign languages in both directions, so the argument that the
demangler should be written in C in order to be used by other modules
not written in C++ is unconvincing.
Maybe, we should find ways to have both demanglers in sync, but
forcing a unique C implementation is wrong.
-- Gaby