New demangler in C++
Mark Mitchell
mark@codesourcery.com
Tue Feb 25 01:26:00 GMT 2003
> | 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.
I guess what I think is this:
- The demangler ought to be able to be linked into GDB, binutils, source
browsers, etc.
- Those applications presently use no C++.
I think that the maintainers could possibly be persuaded to link in one
C++ .o file -- but probably not libstdc++.
So, if the file were written in C++ -- but didn't use <string> -- I'd
probably resist less. You're right that if it's written in C++, but
doesn't use C++ library stuff, that it could present a C interface and
that would be fine.
The key point is that I think it's a big mistake to have two
demanglers. If we're going to write a new one, we should make sure that
it can replace the old one, not just get added to the mix.
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
More information about the Libstdc++
mailing list