Add warning
For example:
struct A {
int b [];
};
This commit is contained in:
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;
|
||||||
|
|||||||
Reference in New Issue
Block a user