This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
egcs-1.1 C++ parser bug fix for extern C
- To: egcs-patches at cygnus dot com
- Subject: egcs-1.1 C++ parser bug fix for extern C
- From: Mumit Khan <khan at xraylith dot wisc dot edu>
- Date: Tue, 08 Sep 1998 14:35:48 -0500
- Cc: jason at cygnus dot com
Please see http://www.cygnus.com/ml/egcs-bugs/1998-Sep/0180.html 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):
=== ext_c_bug1.cc
extern "C" foo ();
=================
% gcc -c ext_c_bug1.cc
ext_c_bug1.cc:1: warning: ANSI C++ forbids declaration `' with no type
ext_c_bug1.cc:1: 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 <khan@xraylith.wisc.edu>
* 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 1.1.1.1
diff -u -3 -p -r1.1.1.1 parse.y
--- parse.y 1998/09/07 00:11:07 1.1.1.1
+++ parse.y 1998/09/08 18:24:16
@@ -1883,7 +1883,7 @@ notype_initdcl0:
nomods_initdcl0:
notype_declarator maybeasm
{ /* Set things up as initdcl0_innards expects. */
- $<ttype>$ = $1;
+ $<ttype>2 = $1;
$1 = NULL_TREE; }
initdcl0_innards
{}
Regards,
Mumit