mirror of
git://repo.or.cz/tinycc.git
synced 2026-07-04 18:38:41 +08:00
Accept empty struct member decls
struct S { /*nothing*/; int a; };
is an acceptable struct declaration, there may be stray semicolons
in the member list.
This commit is contained in:
parent
d5d881d9e9
commit
6763b02abc
5
tccgen.c
5
tccgen.c
@ -3250,7 +3250,10 @@ static void struct_decl(CType *type, AttributeDef *ad, int u)
|
|||||||
offset = 0;
|
offset = 0;
|
||||||
flexible = 0;
|
flexible = 0;
|
||||||
while (tok != '}') {
|
while (tok != '}') {
|
||||||
parse_btype(&btype, &ad1);
|
if (!parse_btype(&btype, &ad1)) {
|
||||||
|
skip(';');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
while (1) {
|
while (1) {
|
||||||
extra_bytes = 0;
|
extra_bytes = 0;
|
||||||
if (flexible)
|
if (flexible)
|
||||||
|
|||||||
@ -642,6 +642,11 @@ union union2 {
|
|||||||
|
|
||||||
struct struct1 st1, st2;
|
struct struct1 st1, st2;
|
||||||
|
|
||||||
|
struct empty_mem {
|
||||||
|
/* nothing */ ;
|
||||||
|
int x;
|
||||||
|
};
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
string_test();
|
string_test();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user