From: Richard Stallman Date: Sun, 18 Oct 1992 08:12:53 +0000 (+0000) Subject: (process_init_constructor): When initializing a union, X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c2f4acb703873f3a4f4e419afadad78417396f0e;p=gcc.git (process_init_constructor): When initializing a union, handle the case of an empty init list. From-SVN: r2507 --- diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 6341cc2ef6b..9c4c1a421be 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -5202,6 +5202,12 @@ process_init_constructor (type, init, elts, constant_value, constant_element, /* For a union, get the initializer for 1 fld. */ + if (tail == 0) + { + error ("empty initializer for union"); + tail = build_tree_list (0, 0); + } + /* If this element specifies a field, initialize via that field. */ if (TREE_PURPOSE (tail) != 0) {