mirror of
https://github.com/cc65/cc65.git
synced 2025-08-08 06:25:17 +00:00
Fixed a problem with function pointer conversion.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3978 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -168,6 +168,16 @@ void TypeConversion (ExprDesc* Expr, Type* NewType)
|
|||||||
* impossible.
|
* impossible.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
|
/* Debugging */
|
||||||
|
printf ("Expr:\n=======================================\n");
|
||||||
|
PrintExprDesc (stdout, Expr);
|
||||||
|
printf ("Type:\n=======================================\n");
|
||||||
|
PrintType (stdout, NewType);
|
||||||
|
printf ("\n");
|
||||||
|
PrintRawType (stdout, NewType);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* First, do some type checking */
|
/* First, do some type checking */
|
||||||
if (IsTypeVoid (NewType) || IsTypeVoid (Expr->Type)) {
|
if (IsTypeVoid (NewType) || IsTypeVoid (Expr->Type)) {
|
||||||
/* If one of the sides are of type void, output a more apropriate
|
/* If one of the sides are of type void, output a more apropriate
|
||||||
@@ -247,8 +257,8 @@ void TypeConversion (ExprDesc* Expr, Type* NewType)
|
|||||||
/* Assignment of function to function pointer is allowed, provided
|
/* Assignment of function to function pointer is allowed, provided
|
||||||
* that both functions have the same parameter list.
|
* that both functions have the same parameter list.
|
||||||
*/
|
*/
|
||||||
if (TypeCmp (NewType, Expr->Type) < TC_EQUAL) {
|
if (TypeCmp (NewType, Expr->Type) < TC_COMPATIBLE) {
|
||||||
Error ("Incompatible types");
|
Error ("Incompatible types");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Error ("Incompatible types");
|
Error ("Incompatible types");
|
||||||
|
Reference in New Issue
Block a user