This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
(C) Patch to finish_incomplete_decl
- To: gcc-patches at gcc dot gnu dot org
- Subject: (C) Patch to finish_incomplete_decl
- From: Jason Merrill <jason at redhat dot com>
- Date: Tue, 5 Sep 2000 23:02:38 -0700
There doesn't seem to be any good reason for forcing extern arrays to
be complete, and it produces bogus debugging info.
2000-09-05 Jason Merrill <jason@redhat.com>
* c-decl.c (finish_incomplete_decl): Don't call complete_array_type
for 'extern' arrays.
Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/c-decl.c,v
retrieving revision 1.150
diff -c -p -r1.150 c-decl.c
*** c-decl.c 2000/09/01 22:09:54 1.150
--- c-decl.c 2000/09/06 02:21:32
*************** finish_incomplete_decl (decl)
*** 859,868 ****
tree type = TREE_TYPE (decl);
if (type != error_mark_node
&& TREE_CODE (type) == ARRAY_TYPE
&& TYPE_DOMAIN (type) == 0)
{
! if (! DECL_EXTERNAL (decl))
! warning_with_decl (decl, "array `%s' assumed to have one element");
complete_array_type (type, NULL_TREE, 1);
--- 859,868 ----
tree type = TREE_TYPE (decl);
if (type != error_mark_node
&& TREE_CODE (type) == ARRAY_TYPE
+ && ! DECL_EXTERNAL (decl)
&& TYPE_DOMAIN (type) == 0)
{
! warning_with_decl (decl, "array `%s' assumed to have one element");
complete_array_type (type, NULL_TREE, 1);