aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrischka <grischka>2009-06-17 02:10:24 +0200
committergrischka <grischka>2009-06-17 02:10:24 +0200
commit956b4beec123644092c1998501412f888672a1c6 (patch)
treee53a261a1473efd635465e475bff9a642da7b252
parent6a004ed19f61c77e5074a7960aaec75ec40aaa3d (diff)
downloadtinycc-956b4beec123644092c1998501412f888672a1c6.tar.gz
tinycc-956b4beec123644092c1998501412f888672a1c6.tar.bz2
incompatible function ptr assignment: just warn
void fn_1(int i) {} void (*fn_2)(char*) = fn_1;
-rw-r--r--tccgen.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tccgen.c b/tccgen.c
index 7ac05d3..5d1a64d 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -1939,9 +1939,8 @@ static void gen_assign_cast(CType *dt)
if (sbt == VT_FUNC) {
if ((type1->t & VT_BTYPE) != VT_VOID &&
!is_compatible_types(pointed_type(dt), st))
- goto error;
- else
- goto type_ok;
+ warning("assignment from incompatible pointer type");
+ goto type_ok;
}
if (sbt != VT_PTR)
goto error;