+2000-10-04 Will Cohen <wcohen@redhat.com>
+
+ * c-typeck.c (process_init_element): Added warning for zero-length
+ array.
+
+ * extend.texi (Zero Length): State that static initializers for
+ zero-length arrays are not allowed.
+
Mon Oct 2 14:50:14 MET DST 2000 Jan Hubicka <jh@suse.cz>
* rtlanal.c (single_set_1): Do not require USE and CLOBBERs
* config/sh/sh.md (sym_label2reg, symPLT_label2reg): Protect
LABEL_REFs with a PIC-safe unspec.
-2000-09-18 Will Cohen <wcohen@redhat.com>
-
- * extend.texi (Zero Length): State that static initializers for
- zero-length arrays are not allowed.
-
- * c-typeck.c (process_init_element): Flag initializers for zero
- length arrays.
-
- * tree.c (integer_all_onesp): Ignore TREE_INT_CST_HIGH if prec is
- exactly HOST_BITS_PERWIDE_INT.
-
2000-09-18 Joseph S. Myers <jsm28@cam.ac.uk>
* c-common.c (check_format_info): Properly save the argument
}
if (constructor_max_index != 0
- && tree_int_cst_lt (constructor_max_index, constructor_index))
+ && (tree_int_cst_lt (constructor_max_index, constructor_index)
+ || integer_all_onesp (constructor_max_index)))
{
pedwarn_init ("excess elements in array initializer");
break;
In standard C, you would have to give @code{contents} a length of 1, which
means either you waste space or complicate the argument to @code{malloc}.
+Static initialization of the zero-length array is not allowed. A
+warning will be generated for each initializer attempting to initialize
+the zero-length array.
+
@node Variable Length
@section Arrays of Variable Length
@cindex variable-length arrays