From: uz Date: Thu, 27 Aug 2009 22:09:46 +0000 (+0000) Subject: When preprocessing, all compares evaluate to constants, so don't print a X-Git-Tag: V2.13.0rc1~197 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c214fa639571d391ce1d4965e594de06c9c5a29c;p=cc65 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 --- 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);