1
0
mirror of https://github.com/cc65/cc65.git synced 2025-08-08 06:25:17 +00:00

Made cc65 accept comparisons between pointers with different qualifiers (similarly to subtractions between pointers).

This commit is contained in:
Greg King
2015-12-29 04:18:17 -05:00
parent 02e4b5bfe3
commit 3b303396bf

View File

@@ -2105,8 +2105,8 @@ static void hie_compare (const GenDesc* Ops, /* List of generators */
*/ */
Type* left = Indirect (Expr->Type); Type* left = Indirect (Expr->Type);
Type* right = Indirect (Expr2.Type); Type* right = Indirect (Expr2.Type);
if (TypeCmp (left, right) < TC_EQUAL && left->C != T_VOID && right->C != T_VOID) { if (TypeCmp (left, right) < TC_QUAL_DIFF && left->C != T_VOID && right->C != T_VOID) {
/* Incomatible pointers */ /* Incompatible pointers */
Error ("Incompatible types"); Error ("Incompatible types");
} }
} else if (!ED_IsNullPtr (&Expr2)) { } else if (!ED_IsNullPtr (&Expr2)) {