This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: host_integerp vs [] decls
> Yep, we've forgotten that [] arrays have no MAX_VALUE in the array.
>
> Should be something like
>
> 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));
Is it time for this change yet? If so, should I get rid of all the
`constructor_max_index == 0' tests too, and just assume it's never
zero?
Index: c-typeck.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-typeck.c,v
retrieving revision 1.137
diff -p -3 -r1.137 c-typeck.c
*** c-typeck.c 2001/09/16 00:48:52 1.137
--- c-typeck.c 2001/09/19 19:17:08
*************** push_init_level (implicit)
*** 5356,5365 ****
= convert (bitsizetype,
TYPE_MIN_VALUE (TYPE_DOMAIN (constructor_type)));
! /* ??? For GCC 3.1, remove special case initialization of
! zero-length array members from pop_init_level and set
! constructor_max_index such that we get the normal
! "excess elements" warning. */
}
else
constructor_index = bitsize_zero_node;
--- 5356,5364 ----
= convert (bitsizetype,
TYPE_MIN_VALUE (TYPE_DOMAIN (constructor_type)));
! /* Detect non-empty initializations of zero-length arrays. */
! if (constructor_max_index == NULL_TREE)
! constructor_max_index = build_int_2 (-1, -1);
}
else
constructor_index = bitsize_zero_node;