incompatible function ptr assignment: just warn
void fn_1(int i) {}
void (*fn_2)(char*) = fn_1;
This commit is contained in:
3
tccgen.c
3
tccgen.c
@ -1939,8 +1939,7 @@ static void gen_assign_cast(CType *dt)
|
|||||||
if (sbt == VT_FUNC) {
|
if (sbt == VT_FUNC) {
|
||||||
if ((type1->t & VT_BTYPE) != VT_VOID &&
|
if ((type1->t & VT_BTYPE) != VT_VOID &&
|
||||||
!is_compatible_types(pointed_type(dt), st))
|
!is_compatible_types(pointed_type(dt), st))
|
||||||
goto error;
|
warning("assignment from incompatible pointer type");
|
||||||
else
|
|
||||||
goto type_ok;
|
goto type_ok;
|
||||||
}
|
}
|
||||||
if (sbt != VT_PTR)
|
if (sbt != VT_PTR)
|
||||||
|
|||||||
Reference in New Issue
Block a user