This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] c-typeck.c: digest_init vs sizeless arrays
- To: gcc-patches at gcc dot gnu dot org
- Subject: [patch] c-typeck.c: digest_init vs sizeless arrays
- From: DJ Delorie <dj at redhat dot com>
- Date: Mon, 24 Sep 2001 16:05:20 -0400
- CC: dj at redhat dot com
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