aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2001-09-26 17:02:16 -0400
committerDJ Delorie <dj@gcc.gnu.org>2001-09-26 17:02:16 -0400
commita63f73f88ff77aa4c3b2d8a4a71efe0773ecf854 (patch)
tree300779a5ba59b39c9384b8359b058493719dd162
parent9c2f7166cbaad7eed6b8155daf6b4e1df1fea3a5 (diff)
downloadgcc-a63f73f88ff77aa4c3b2d8a4a71efe0773ecf854.zip
gcc-a63f73f88ff77aa4c3b2d8a4a71efe0773ecf854.tar.gz
gcc-a63f73f88ff77aa4c3b2d8a4a71efe0773ecf854.tar.bz2
* c-typeck.c (digest_init): Check for sizeless arrays.
From-SVN: r45831
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/c-typeck.c1
2 files changed, 5 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a63b303..0e5933e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2001-09-26 DJ Delorie <dj@redhat.com>
+
+ * c-typeck.c (digest_init): Check for sizeless arrays.
+
2001-09-26 Richard Henderson <rth@redhat.com>
* optabs.c (init_one_libfunc): Create a dummy function type
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index c3d11fe..c407f16 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