public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/12873] New: __cxa_demangle not working as specified in ABI
@ 2003-11-02  0:05 rmerkert at alphatech dot com
  2003-11-02  1:10 ` [Bug libstdc++/12873] __cxa_demangle not working as specified in 3.3.2 ABI rmerkert at alphatech dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: rmerkert at alphatech dot com @ 2003-11-02  0:05 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12873

           Summary: __cxa_demangle not working as specified in ABI
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rmerkert at alphatech dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: gcc (GCC) 3.4 20031026 (experimental)

This test program produces different results for 3.3.2 and 3.4.

cat > test.c <<EOF
#include <stdio.h>
#include <stdlib.h>

extern char *__cxa_demangle (const char *__mangled_name,
                             char *__output_buffer,
                             __SIZE_TYPE__ *__length,
                             int *__status);


int main(int argc, char** argv)
{
  for (int i=1;i<argc;++i) {
    int status;
    char* res = __cxa_demangle(argv[i],0,0,&status);
    if (res!=NULL || status!=0) {
      printf("Demangled '%s' as '%s'\n",argv[i],res);
    }
    else {
      printf("Could not demangle '%s'\n",argv[i]);
    }
    free(res);
  }
  return 0;
}

EOF

/local/gcc/bin/gcc -o test test.c -std=c99 /local/gcc/lib/libstdc++.a

'./test hello'

produces

Demangled 'hello' as 'unsigned char'

Also, if I don't pass the status flag pointer, then  I get 

Could not demangle 'hello'


Code is working in mainline, but it would be nice to have it work in 3.3
release series as well. 

Can this be backported?


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-12-05  7:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-02  0:05 [Bug libstdc++/12873] New: __cxa_demangle not working as specified in ABI rmerkert at alphatech dot com
2003-11-02  1:10 ` [Bug libstdc++/12873] __cxa_demangle not working as specified in 3.3.2 ABI rmerkert at alphatech dot com
2003-11-02  1:11 ` rmerkert at alphatech dot com
2003-11-02  2:21 ` carlo at gcc dot gnu dot org
2003-11-02 21:58 ` [Bug libstdc++/12873] [3.3 only] " pinskia at gcc dot gnu dot org
2003-12-05  7:04 ` bkoz at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).