This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Committed: Fix for C99 thinko in c++/3394 fix (but still present onbranch)
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: <mark at codesourcery dot com>, <gcc-patches at gcc dot gnu dot org>, <rodrigc at mediaone dot net>, <khan at nanotech dot wisc dot edu>, <gcc-gnats at gcc dot gnu dot org>
- Date: Mon, 3 Dec 2001 18:21:52 -0500 (EST)
- Subject: Committed: Fix for C99 thinko in c++/3394 fix (but still present onbranch)
You must not use C99 constructs in gcc (presumably for at least
the next 10 years ;-) not even in non-C front-ends. There
should be some option used to prevent this at build time, so
you'd see a build error in a native bootstrap too. I see the
regression checker has already screamed, presumably at Mumit,
who may be off-line; he wasn't the committer. I also corrected
spacing in that ChangeLog entry (patch at end).
With this patch, cc1plus builds again on i686-pc-linux-gnu -x-
mmix-knuth-mmixware. Committed as obvious on the trunk *BUT NOT
ON THE BRANCH*. I strongly believe it must be fixed there too
before the release, or cross-compiler people will get quite mad,
because we'd have to install gcc-3.0 on the host before
compiling target tool-chains. I'm not sure I'm allowed to touch
the branch, though.
* decl.c (xref_basetypes): Don't use C99 construct in tag_code
declaration and initialization.
Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.831
diff -p -c -r1.831 decl.c
*** decl.c 2001/12/03 12:50:36 1.831
--- decl.c 2001/12/03 22:45:17
*************** xref_basetypes (code_type_node, name, re
*** 12849,12854 ****
--- 12849,12855 ----
tree base;
int i, len;
+ enum tag_types tag_code;
/* If we are called from the parser, code_type_node will sometimes be a
TREE_LIST. This indicates that the user wrote
*************** xref_basetypes (code_type_node, name, re
*** 12857,12863 ****
if (TREE_CODE (code_type_node) == TREE_LIST)
code_type_node = TREE_VALUE (code_type_node);
! enum tag_types tag_code = (enum tag_types) tree_low_cst (code_type_node, 1);
if (tag_code == union_type)
{
--- 12858,12864 ----
if (TREE_CODE (code_type_node) == TREE_LIST)
code_type_node = TREE_VALUE (code_type_node);
! tag_code = (enum tag_types) tree_low_cst (code_type_node, 1);
if (tag_code == union_type)
{
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/ChangeLog,v
retrieving revision 1.2579
diff -p -c -r1.2579 ChangeLog
*** ChangeLog 2001/12/03 23:15:07 1.2579
--- ChangeLog 2001/12/03 23:17:15
***************
*** 11,18 ****
2001-12-03 Mumit Khan <khan@nanotech.wisc.edu>
PR c++/3394
! * decl.c (xref_basetypes): Handle attributes between
! 'class' and name.
2001-12-03 Nathan Sidwell <nathan@codesourcery.com>
--- 11,18 ----
2001-12-03 Mumit Khan <khan@nanotech.wisc.edu>
PR c++/3394
! * decl.c (xref_basetypes): Handle attributes between
! 'class' and name.
2001-12-03 Nathan Sidwell <nathan@codesourcery.com>
brgds, H-P