This is the mail archive of the gcc-patches@gcc.gnu.org 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]

(C) Patch to finish_incomplete_decl


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);
  

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