This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

egcs-1.1 C++ parser bug fix for extern C

Please see for my bug 
report to egcs-bugs.

The following patch fixes the following bug in the C++ parser (introduced
since egcs-1.0.3a when initdcl0_innards was added):
  extern "C" foo ();

  % gcc -c warning: ANSI C++ forbids declaration `' with no type abstract declarator `int' used as declaration

This bug is causing a real headache thanks for lots of legacy C headers
that need to be maintained.

The parser stack in nomods_initdcl0 is setup incorrectly, and so when
initdcl0_innards calls parse_decl(), incorrect parameter is passed for
the declarator.

No testsuite regressions for i686-pc-linux-gnu and hppa1.1-hp-hpux10.20.

Tue Sep  8 14:25:15 1998  Mumit Khan  <>

	* parse.y (nomods_initdcl0): Set up the parser stack correctly.

Index: gcc/cp/parse.y
RCS file: /mounts/sda7/src/gnu/CVSROOT/egcs-1.1-release/gcc/cp/parse.y,v
retrieving revision
diff -u -3 -p -r1.1.1.1 parse.y
--- parse.y	1998/09/07 00:11:07
+++ parse.y	1998/09/08 18:24:16
@@ -1883,7 +1883,7 @@ notype_initdcl0:
           notype_declarator maybeasm
             { /* Set things up as initdcl0_innards expects.  */
-	      $<ttype>$ = $1; 
+	      $<ttype>2 = $1; 
               $1 = NULL_TREE; }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]