aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2001-09-20 20:27:59 -0400
committerDJ Delorie <dj@gcc.gnu.org>2001-09-20 20:27:59 -0400
commite7b6a0ee34197334228ed9185ebaf84d5b975110 (patch)
tree367fe25e25603ec8574df8960ea2e634f886da63 /gcc/expr.c
parentf5aee6316d591598ac8574b47b79fa35e10bca2c (diff)
downloadgcc-e7b6a0ee34197334228ed9185ebaf84d5b975110.zip
gcc-e7b6a0ee34197334228ed9185ebaf84d5b975110.tar.gz
gcc-e7b6a0ee34197334228ed9185ebaf84d5b975110.tar.bz2
c-typeck.c (really_start_incremental_init): Discriminate between zero-length arrays and flexible arrays.
* c-typeck.c (really_start_incremental_init): Discriminate between zero-length arrays and flexible arrays. (push_init_level): Detect zero-length arrays and handle them like fixed-sized arrays. * expr.c (store_constructor): Handle zero-length arrays and flexible arrays correctly. * doc/extend.texi: Update zero-length array notes. * gcc.dg/20000926-1.c: Update expected warning messages. * gcc.dg/array-2.c: Likewise, and test for warnings too. * gcc.dg/array-4.c: Likewise, and don't verify the zero-length array. From-SVN: r45714
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 3d0d93a..b61fc17 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -4710,7 +4710,9 @@ store_constructor (exp, target, align, cleared, size)
int need_to_clear;
tree domain = TYPE_DOMAIN (type);
tree elttype = TREE_TYPE (type);
- int const_bounds_p = (host_integerp (TYPE_MIN_VALUE (domain), 0)
+ int const_bounds_p = (TYPE_MIN_VALUE (domain)
+ && TYPE_MAX_VALUE (domain)
+ && host_integerp (TYPE_MIN_VALUE (domain), 0)
&& host_integerp (TYPE_MAX_VALUE (domain), 0));
HOST_WIDE_INT minelt = 0;
HOST_WIDE_INT maxelt = 0;