From c214fa639571d391ce1d4965e594de06c9c5a29c Mon Sep 17 00:00:00 2001 From: uz Date: Thu, 27 Aug 2009 22:09:46 +0000 Subject: [PATCH] When preprocessing, all compares evaluate to constants, so don't print a warning in this case. git-svn-id: svn://svn.cc65.org/cc65/trunk@4059 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/expr.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cc65/expr.c b/src/cc65/expr.c index e8c962967..6c6268cc1 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -1884,8 +1884,13 @@ static void hie_compare (const GenDesc* Ops, /* List of generators */ /* Check for const operands */ if (ED_IsConstAbs (Expr) && rconst) { - - Warning ("Result of comparison is constant"); + + /* If the result is constant, this is suspicious when not in + * preprocessor mode. + */ + if (!Preprocessing) { + Warning ("Result of comparison is constant"); + } /* Both operands are constant, remove the generated code */ RemoveCode (&Mark1); -- 2.39.5