aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2026-04-14 21:59:46 +0200
committerlemon <lsof@mailbox.org>2026-04-14 22:20:33 +0200
commit35efb4b54b6a8252b30ec32bc23ed34f15a95e5c (patch)
treede9d0170ed868a5d77ff748c4c1c09eb35ecfb27 /src
parent93f08f8d3095b8d66712c6bf33977d930a63456f (diff)
c: allow nested aggregate with flexible array member
Diffstat (limited to 'src')
-rw-r--r--src/c.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/c.c b/src/c.c
index 73a03cb..6201812 100644
--- a/src/c.c
+++ b/src/c.c
@@ -2080,8 +2080,10 @@ buildagg(CComp *cm, enum typetag tt, internstr name, int id)
td.anyconst |= decl.qual & QCONST;
if (isagg(decl.ty)) {
td.anyconst |= typedata[decl.ty.dat].anyconst;
- if (typedata[decl.ty.dat].flexi && !isunion)
- error(&decl.span, "nested aggregate has flexible array member");
+ if (typedata[decl.ty.dat].flexi && !isunion) {
+ td.flexi = 1;
+ flexspan = decl.span;
+ }
}
if (isunion) {
td.siz = td.siz < siz ? siz : td.siz;