aboutsummaryrefslogtreecommitdiff
path: root/tccgen.c
diff options
context:
space:
mode:
authorjiang <30155751@qq.com>2014-05-14 20:44:53 +0800
committerjiang <30155751@qq.com>2014-05-14 20:44:53 +0800
commitfcb3772a3424ff64b43516bde98f113e454c7a6f (patch)
tree39e33974b3945ed460648d8ee8b20774ce75c084 /tccgen.c
parent07614b5e22073cbb2c1b298ab906d57372619604 (diff)
downloadtinycc-fcb3772a3424ff64b43516bde98f113e454c7a6f.tar.gz
tinycc-fcb3772a3424ff64b43516bde98f113e454c7a6f.tar.bz2
Add warning 3
struct st {int a;} ss; int b; b = ss;
Diffstat (limited to 'tccgen.c')
-rw-r--r--tccgen.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tccgen.c b/tccgen.c
index 0937883..9076da5 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: