c-typeck.c (process_init_element): Detect excess elements in char array initializer.
authorNathan Sidwell <nathan@acm.org>
Mon, 14 Jun 1999 02:40:16 +0000 (02:40 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Mon, 14 Jun 1999 02:40:16 +0000 (02:40 +0000)
* c-typeck.c (process_init_element): Detect excess elements in
char array initializer.

From-SVN: r27507

gcc/ChangeLog
gcc/c-typeck.c

index 58facf2eff7bf0633040eaf1c2f39b40e34137bd..6383d5d31361cba3afeedcc41ee5d99c78fb1f4c 100644 (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.
index 854baf888235aa3305149a016ec5f5999f766a99..95d417e1d8d463e974a6eac7126118225314d504 100644 (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;
     }