From 9317db6642a512cb0318d134daeb6d7f07299ab7 Mon Sep 17 00:00:00 2001 From: acqn Date: Sat, 8 Aug 2020 06:46:22 +0800 Subject: [PATCH] Slightly improved type error messages of 'op='. --- src/cc65/expr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cc65/expr.c b/src/cc65/expr.c index 7b9fd0b9d..817234ec8 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -3408,7 +3408,7 @@ static void opeq (const GenDesc* Gen, ExprDesc* Expr, const char* Op) /* There must be an integer or pointer on the left side */ if (!IsClassInt (Expr->Type) && !IsTypePtr (Expr->Type)) { - Error ("Invalid left operand type"); + Error ("Invalid left operand for binary operator '%s'", Op); /* Continue. Wrong code will be generated, but the compiler won't ** break, so this is the best error recovery. */ @@ -3532,7 +3532,7 @@ static void addsubeq (const GenDesc* Gen, ExprDesc *Expr, const char* Op) /* There must be an integer or pointer on the left side */ if (!IsClassInt (Expr->Type) && !IsTypePtr (Expr->Type)) { - Error ("Invalid left operand type"); + Error ("Invalid left operand for binary operator '%s'", Op); /* Continue. Wrong code will be generated, but the compiler won't ** break, so this is the best error recovery. */