home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / gnu / g / bug / 2334 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.6 KB  |  44 lines

  1. Path: sparky!uunet!cis.ohio-state.edu!xenon.stanford.edu!hoelzle
  2. From: hoelzle@xenon.stanford.edu (Urs Hoelzle)
  3. Newsgroups: gnu.g++.bug
  4. Subject: g++ 2.3.3 ignores 'extern "C"'
  5. Date: 25 Jan 1993 21:18:54 -0500
  6. Organization: CS Department, Stanford University, California, USA
  7. Lines: 31
  8. Sender: daemon@cis.ohio-state.edu
  9. Approved: bug-g++@prep.ai.mit.edu
  10. Distribution: gnu
  11. Message-ID: <hoelzle.728002480@Xenon.Stanford.EDU>
  12.  
  13. -------- x.c ---------------
  14. # include <stdlib.h>
  15. # include <malloc.h>
  16.  
  17. extern "C" void* malloc(int size) {  return 0; }
  18. ---------------------------
  19.  
  20. g++ -v -c x.c -o x.o ; nm x.o
  21. Reading specs from /home/kahuna/local/lib/gcc-lib/sparc-sun-sunos4.1/2.3.3/specs
  22. gcc version 2.3.3
  23.  /home/kahuna/local/lib/gcc-lib/sparc-sun-sunos4.1/2.3.3/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix x.c /usr/tmp/cca26496.i
  24. GNU CPP version 2.3.3 (sparc)
  25.  /home/kahuna/local/lib/gcc-lib/sparc-sun-sunos4.1/2.3.3/cc1plus /usr/tmp/cca26496.i -quiet -dumpbase x.cc -version -o /usr/tmp/cca26496.s
  26. GNU C++ version 2.3.3 (sparc) compiled by GNU C version 2.3.3.
  27.  as -o x.o /usr/tmp/cca26496.s
  28. 00000000 T _malloc__Fv
  29. 00000000 t gcc2_compiled.
  30.  
  31.  
  32. i.e. g++ generates a mangled name (_malloc__Fv) instead of _malloc.  If you
  33. take out the inlcude of <malloc.h> it works.
  34.  
  35. g++ 2.2.2 already had problems with this ("program cc1plus got fatal
  36. signal 11").
  37.  
  38. -Urs
  39.  
  40. ----------------------------------------------------------------------------
  41. Urs Hoelzle                                              urs@cs.stanford.EDU
  42. Computer Systems Laboratory, CIS 57, Stanford University, Stanford, CA 94305
  43.  
  44.