From 6763b02abc5e0076b6f5bc0e116205250ef9fbd6 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Tue, 28 Jun 2016 15:09:40 +0200 Subject: Accept empty struct member decls struct S { /*nothing*/; int a; }; is an acceptable struct declaration, there may be stray semicolons in the member list. --- tccgen.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tccgen.c') diff --git a/tccgen.c b/tccgen.c index 4d35bed..930993a 100644 --- a/tccgen.c +++ b/tccgen.c @@ -3250,7 +3250,10 @@ static void struct_decl(CType *type, AttributeDef *ad, int u) offset = 0; flexible = 0; while (tok != '}') { - parse_btype(&btype, &ad1); + if (!parse_btype(&btype, &ad1)) { + skip(';'); + continue; + } while (1) { extra_bytes = 0; if (flexible) -- cgit v1.3.1