1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 23:29:39 +00:00

Merge pull request #1829 from acqn/VoidPtrFix

[cc65] Fixed superfluous warning on pointer types comparing a non-void pointer to a void pointer.
This commit is contained in:
Bob Andrews 2022-08-09 14:29:56 +02:00 committed by GitHub
commit e30e233064
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2340,7 +2340,7 @@ static void hie_compare (const GenDesc* Ops, /* List of generators */
} else if (IsClassPtr (Expr->Type)) {
if (IsClassPtr (Expr2.Type)) {
/* Pointers are allowed in comparison */
if (TypeCmp (Expr->Type, Expr2.Type).C < TC_STRICT_COMPATIBLE) {
if (TypeCmp (Expr->Type, Expr2.Type).C < TC_VOID_PTR) {
/* Warn about distinct pointer types */
TypeCompatibilityDiagnostic (PtrConversion (Expr->Type), PtrConversion (Expr2.Type), 0,
"Distinct pointer types comparing '%s' with '%s'");