c-typeck.c (process_init_element): Detect excess elements in char array initializer.

* c-typeck.c (process_init_element): Detect excess elements in
	char array initializer.

From-SVN: r27507
This commit is contained in:
Nathan Sidwell 1999-06-14 02:40:16 +00:00 committed by Nathan Sidwell
parent 8dae700b78
commit d739a3bc88
2 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Mon Jun 14 10:30:52 BST 1999 Nathan Sidwell <nathan@acm.org>
* c-typeck.c (process_init_element): Detect excess elements in
char array initializer.
1999-06-14 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* gcc.texi: Mention gcc 2.96 instead of egcs 1.00.

View File

@ -6478,6 +6478,8 @@ process_init_element (value)
&& TREE_CODE (TREE_TYPE (constructor_type)) == INTEGER_TYPE
&& integer_zerop (constructor_unfilled_index))
{
if (constructor_stack->replacement_value)
error_init ("excess elements in char array initializer");
constructor_stack->replacement_value = value;
return;
}