From fb9c097981190629b926e0e8b87819c2b55954a0 Mon Sep 17 00:00:00 2001 From: uz Date: Tue, 28 Jul 2009 19:21:38 +0000 Subject: [PATCH] Fixed a problem with function pointer conversion. git-svn-id: svn://svn.cc65.org/cc65/trunk@3978 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/typeconv.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/cc65/typeconv.c b/src/cc65/typeconv.c index 86c07ec88..e9f72ee11 100644 --- a/src/cc65/typeconv.c +++ b/src/cc65/typeconv.c @@ -168,6 +168,16 @@ void TypeConversion (ExprDesc* Expr, Type* NewType) * 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 */ if (IsTypeVoid (NewType) || IsTypeVoid (Expr->Type)) { /* 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 * that both functions have the same parameter list. */ - if (TypeCmp (NewType, Expr->Type) < TC_EQUAL) { - Error ("Incompatible types"); + if (TypeCmp (NewType, Expr->Type) < TC_COMPATIBLE) { + Error ("Incompatible types"); } } else { Error ("Incompatible types"); -- 2.39.5