home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / gnu / g / bug / 2065 < prev    next >
Encoding:
Text File  |  1992-12-22  |  3.2 KB  |  87 lines

  1. Newsgroups: gnu.g++.bug
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cygnus.com!mrs
  3. From: mrs@cygnus.com (Mike Stump)
  4. Subject: Re:  [joost@ori.cadlab.de: seg-fault on contradicting prototypes, C++ & extern "C"]
  5. Message-ID: <9212212157.AA15282@cygnus.com>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Mon, 21 Dec 1992 21:57:25 GMT
  10. Approved: bug-g++@prep.ai.mit.edu
  11. Lines: 74
  12.  
  13. This problem has been fixed, and should not exist in the next release of gcc.
  14.  
  15. > From: Michael Joosten <joost@ori.cadlab.de>
  16. > Date: Wed, 1 Apr 92 21:22:03 +0200
  17. > To: bug-gcc@prep.ai.mit.edu
  18. > Reply-To: joost@cadlab.uni-paderborn.de
  19.  
  20. > Machine: sparc-sun-sunos41
  21.  
  22. > Compiled with: -O
  23.  
  24. > Version of cc1plus:
  25. > >cc1plus -version
  26. > GNU C++ version 2.1 (sparc) compiled by GNU C version 2.1.
  27. > enabled: -fdefer-pop -fpeephole -ffunction-cse -fcommon -fgnu-linker
  28. >          -mfpu -mepilogue
  29.  
  30. > Input File:
  31. > > cat T.i
  32.  
  33. > int strcmp();
  34.  
  35. > extern "C" {
  36. > int strcmp(const char*, const char*);
  37. > }
  38.  
  39. > Arguments: cc1plus T.i
  40.  
  41. > Symptoms: Immediate Segmentation Violation. This also occurs in 2.0 and on
  42. > sun3 (m68k-sun-sunos41).
  43.  
  44. > Gdb-4.4 says:
  45. > (Sorry, no debugging info, it was way too large...)
  46.  
  47. > Program terminated with signal 11, Segmentation fault.
  48. > Reading symbols from /usr/lib/libc.so.1.6...done.
  49. > #0  0x32dc0 in common_type (t1=0x1800c0, t2=0x17fee8) at ../gcc-2.1/cp-typeck.c:312
  50. > #1  0x32998 in commonparms (p1=0x180ad8, p2=0x17ff88) at ../gcc-2.1/cp-typeck.c:220
  51. > #2  0x330f4 in common_type (t1=0x180af0, t2=0x180d60) at ../gcc-2.1/cp-typeck.c:378
  52. > #3  0x1627c in duplicate_decls (newdecl=0x1947d8, olddecl=0x183030)
  53. >     at ../gcc-2.1/cp-decl.c:2056
  54. > #4  0x16fdc in pushdecl (x=0x1947d8) at ../gcc-2.1/cp-decl.c:2364
  55. > #5  0x1d788 in start_decl (declarator=0x1787c8, declspecs=0x175548, initialized=0, 
  56. >     raises=0x0) at ../gcc-2.1/cp-decl.c:4693
  57. > #6  0xe360 in yyparse ()
  58. > #7  0x87c64 in output_file_directive ()
  59. > #8  0x8a74c in main ()
  60.  
  61. > The crash is here in cp-typecheck:common_type()
  62.  
  63. >     case POINTER_TYPE:
  64. >     case REFERENCE_TYPE:
  65. >       /* For two pointers, do this recursively on the target type,
  66. >      and combine the qualifiers of the two types' targets.  */
  67. >       {
  68. > =>    tree target = common_type (TYPE_MAIN_VARIANT (TREE_TYPE (t1)),
  69. >                    TYPE_MAIN_VARIANT (TREE_TYPE (t2)));
  70. >     int constp
  71.  
  72. > Seems that the compare of the '()'  paramlist in t2 with the (const char*,
  73. > const char*) hasn't checked 'comptypes' ?
  74.  
  75. > Hope that this little buggy is really easily reproducible 8-)
  76.  
  77. >  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  78. > | Michael Joosten   |       Tel.  : (+49) (+) 5251-284 120                 |
  79. > | CADLAB            |       Fax   : (+49) (+) 5251-284 140                 |
  80. > | Bahnhofstr. 32    |       E-Mail: joost@cadlab.de                        |
  81. > | D-4790 Paderborn  |                ...!uunet!unido!cadlab!joost           | 
  82. > | FRG               | Mass mail to: joost@pbinfo.uni-paderborn.de          |
  83. > |--------------------------------------------------------------------------|
  84. > | CADLAB is a cooperation between Uni-GH Paderborn & SNI AG                |
  85. >  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  86.  
  87.