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]

[patch] c-typeck.c: digest_init vs sizeless arrays



2001-09-24  DJ Delorie  <dj@redhat.com>

	* c-typeck.c (digest_init): Check for sizeless arrays.

Index: c-typeck.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-typeck.c,v
retrieving revision 1.138
diff -p -3 -r1.138 c-typeck.c
*** c-typeck.c	2001/09/21 00:27:58	1.138
--- c-typeck.c	2001/09/24 20:02:07
*************** digest_init (type, init, require_constan
*** 4690,4695 ****
--- 4690,4696 ----
  
  	  TREE_TYPE (inside_init) = type;
  	  if (TYPE_DOMAIN (type) != 0
+ 	      && TYPE_SIZE (type) != 0
  	      && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
  	      /* Subtract 1 (or sizeof (wchar_t))
  		 because it's ok to ignore the terminating null char


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