From a63f73f88ff77aa4c3b2d8a4a71efe0773ecf854 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Wed, 26 Sep 2001 17:02:16 -0400 Subject: [PATCH] * c-typeck.c (digest_init): Check for sizeless arrays. From-SVN: r45831 --- gcc/ChangeLog | 4 ++++ gcc/c-typeck.c | 1 + 2 files changed, 5 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a63b3030d9b..0e5933ed2d8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2001-09-26 DJ Delorie + + * c-typeck.c (digest_init): Check for sizeless arrays. + 2001-09-26 Richard Henderson * optabs.c (init_one_libfunc): Create a dummy function type diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index c3d11fe7316..c407f16d640 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -4690,6 +4690,7 @@ digest_init (type, init, require_constant, constructor_constant) 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