This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/16845] demangler not working for plain "int"
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Jul 2004 23:42:28 -0000
- Subject: [Bug libstdc++/16845] demangler not working for plain "int"
- References: <20040731110453.16845.igodard@pacbell.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From igodard at pacbell dot net 2004-07-31 23:42 -------
After reading the citations from pinskia, it seems that there is a bug here regardless of the semantics. Your ABI may require that "i" demangle as "i", although I'd be appalled that it would, or as "int", but if you look at the test case it demangles as nothing at all (and reports a -2 error). That has to be a bug.
Three comments:
1) I understand that there must be a link/RTTI demangler for data names. However, the ability to print a typename (from "typeid(...).name()") is also important to those mere users who are not compiler implementers. If the demangling syntax is different across the two cases (and if it is I predict big trouble when the day comes that you need to support an "extern "C" typedef...") then the library should provide a means by which both are available. The demangler in 3.4.0 /ext/demangle.h does so, but appears to be otherwise hopelessly broken (I tried to use it as a workaround).
2) At least for use from c++, the demangler should be integrated with streams; then the desired semantics can be specified by a format effector, as is done with "bool". The demangler should not have an interface that invites buffer-overrun exploits.
3) IMO, RTTI type info improvement is desperately needed. You know what you have to do to print the name of an enum value?
Ivan
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16845