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:
parent
32348f5778
commit
fb9c097981
1 changed files with 12 additions and 2 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue