Add warning 2
For example:
struct A {
int b: 16;
int c: 16
};
sizeof (struct A);
This commit is contained in:
2
tccgen.c
2
tccgen.c
@ -3795,6 +3795,8 @@ ST_FUNC void unary(void)
|
|||||||
if (!(type.t & VT_VLA)) {
|
if (!(type.t & VT_VLA)) {
|
||||||
if (size < 0)
|
if (size < 0)
|
||||||
tcc_error("sizeof applied to an incomplete type");
|
tcc_error("sizeof applied to an incomplete type");
|
||||||
|
if(type.t & VT_BITFIELD)
|
||||||
|
tcc_error("'%s' applied to a bit-field", get_tok_str(t, NULL));
|
||||||
vpushs(size);
|
vpushs(size);
|
||||||
} else {
|
} else {
|
||||||
vla_runtime_type_size(&type, &align);
|
vla_runtime_type_size(&type, &align);
|
||||||
|
|||||||
Reference in New Issue
Block a user