From 03687729ecd22de41575f9f6404f107fbfe54b66 Mon Sep 17 00:00:00 2001 From: jiang <30155751@qq.com> Date: Fri, 9 May 2014 22:41:45 +0800 Subject: [PATCH] Add warning 2 For example: struct A { int b: 16; int c: 16 }; sizeof (struct A); --- tccgen.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tccgen.c b/tccgen.c index c37e27b4..c823d42e 100644 --- a/tccgen.c +++ b/tccgen.c @@ -3795,6 +3795,8 @@ ST_FUNC void unary(void) if (!(type.t & VT_VLA)) { if (size < 0) 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); } else { vla_runtime_type_size(&type, &align); -- 2.11.4.GIT