From: Nathan Sidwell Date: Mon, 14 Jun 1999 02:40:16 +0000 (+0000) Subject: c-typeck.c (process_init_element): Detect excess elements in char array initializer. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d739a3bc88c0679f753e5ef404c7ddef4d95ccde;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 58facf2eff7..6383d5d3136 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Mon Jun 14 10:30:52 BST 1999 Nathan Sidwell + + * c-typeck.c (process_init_element): Detect excess elements in + char array initializer. + 1999-06-14 Andreas Jaeger * gcc.texi: Mention gcc 2.96 instead of egcs 1.00. diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 854baf88823..95d417e1d8d 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -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; }