aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/symbol.c
diff options
Diffstat (limited to 'symbol.c')
-rw-r--r--symbol.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/symbol.c b/symbol.c
index 6633e89d..e578b1a8 100644
--- a/symbol.c
+++ b/symbol.c
@@ -95,6 +95,9 @@ struct struct_union_info {
*/
static void lay_out_union(struct symbol *sym, struct struct_union_info *info)
{
+ if (sym->bit_size < 0 && is_array_type(sym))
+ sparse_error(sym->pos, "flexible array member '%s' in a union", show_ident(sym->ident));
+
if (sym->bit_size > info->bit_size)
info->bit_size = sym->bit_size;