From 35efb4b54b6a8252b30ec32bc23ed34f15a95e5c Mon Sep 17 00:00:00 2001 From: lemon Date: Tue, 14 Apr 2026 21:59:46 +0200 Subject: c: allow nested aggregate with flexible array member --- src/c.c | 6 ++++-- 1 file 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; -- cgit v1.2.3