projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e8db481
)
(process_init_constructor): When initializing a union,
author
Richard Stallman
<rms@gnu.org>
Sun, 18 Oct 1992 08:12:53 +0000
(08:12 +0000)
committer
Richard Stallman
<rms@gnu.org>
Sun, 18 Oct 1992 08:12:53 +0000
(08:12 +0000)
handle the case of an empty init list.
From-SVN: r2507
gcc/c-typeck.c
patch
|
blob
|
history
diff --git
a/gcc/c-typeck.c
b/gcc/c-typeck.c
index 6341cc2ef6b35f168239529de7689f3866fc8ed0..9c4c1a421be7665f7583e73e21a31e0f9e086f56 100644
(file)
--- 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)
{