mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-31 06:20:06 +08:00
Add warning
For example: struct A { int b []; };
This commit is contained in:
parent
0f51ccd4e4
commit
14d0aa450f
2
tccgen.c
2
tccgen.c
@ -3030,6 +3030,8 @@ static void struct_decl(CType *type, int u, int tdef)
|
|||||||
skip(';');
|
skip(';');
|
||||||
}
|
}
|
||||||
skip('}');
|
skip('}');
|
||||||
|
if (!c && flexible)
|
||||||
|
tcc_error("flexible array member '%s' in otherwise empty struct", get_tok_str(v, NULL));
|
||||||
/* store size and alignment */
|
/* store size and alignment */
|
||||||
s->c = (c + maxalign - 1) & -maxalign;
|
s->c = (c + maxalign - 1) & -maxalign;
|
||||||
s->r = maxalign;
|
s->r = maxalign;
|
||||||
|
Loading…
Reference in New Issue
Block a user