home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / cplus / 11433 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  1.7 KB

  1. Path: sparky!uunet!gatech!prism!gg10
  2. From: gg10@prism.gatech.EDU (GALLOWAY)
  3. Newsgroups: comp.lang.c++
  4. Subject: Bug in Sun C++ Demangler
  5. Message-ID: <64214@hydra.gatech.EDU>
  6. Date: 23 Jul 92 20:58:19 GMT
  7. Organization: Georgia Institute of Technology
  8. Lines: 42
  9.  
  10. I have found a problem with the demangler used in Sun's SC1.0 C++ 2.1
  11. (really AT&T cfont 2.1.03).  The bug may not be in cfront itself, and only in
  12. utilities like nm++, dem, c++filt, etc.
  13.  
  14. A source file to reproduce the error follows:
  15.  
  16. > cat foo.cc
  17. void foo(double x1, double y1, double z1, int c1,
  18.          double x2, double y2, double z2, int c2)
  19. {
  20. }
  21.  
  22. > CC -c foo.cc
  23. "foo.cc", line 1: warning:  x1 not used
  24. "foo.cc", line 1: warning:  y1 not used
  25. "foo.cc", line 1: warning:  z1 not used
  26. "foo.cc", line 1: warning:  c1 not used
  27. "foo.cc", line 2: warning:  x2 not used
  28. "foo.cc", line 2: warning:  y2 not used
  29. "foo.cc", line 2: warning:  z2 not used
  30. "foo.cc", line 2: warning:  c2 not used
  31.  
  32. > nm++ foo.o
  33. 00000000 T   foo(double,double,double,int,double,double,double,double)
  34.              [_foo__FdN21iN31T4]
  35.  
  36. >> dem _foo__FdN21iN31T4
  37. _foo__FdN21iN31T4 == _foo(double,double,double,int,double,double,double,double)
  38.  
  39. >> echo _foo__FdN21iN31T4 | c++filt -v
  40. Demangler Version 1.5, Date 7/27/88
  41. foo(double,double,double,int,double,double,double,double) 
  42.  
  43. The last argument of type "double" should be an "int".  The "T4" in the
  44. mangled name says "same type as parameter 4" which is indeed an "int".
  45. There are several other similar functions which all demangle incorrectly.
  46.  
  47. I have only posted this to comp.lang.c++.  Could someone let me know how, or
  48. send this on to the proper people at Sun and/or AT&T?
  49.  
  50. Greg Galloway (gg10@prism.gatech.edu)
  51. Georgia Tech Research Institute/Electro-Optics Physical Sciences Laboratory
  52.