From fcb3772a3424ff64b43516bde98f113e454c7a6f Mon Sep 17 00:00:00 2001 From: jiang <30155751@qq.com> Date: Wed, 14 May 2014 20:44:53 +0800 Subject: [PATCH] Add warning 3 struct st {int a;} ss; int b; b = ss; --- tccgen.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tccgen.c b/tccgen.c index 0937883a..9076da51 100644 --- a/tccgen.c +++ b/tccgen.c @@ -2441,6 +2441,8 @@ static void gen_assign_cast(CType *dt) if (sbt == VT_PTR || sbt == VT_FUNC) { tcc_warning("assignment makes integer from pointer without a cast"); } + if (sbt == VT_STRUCT) + goto error; /* XXX: more tests */ break; case VT_STRUCT: