]> git.sur5r.net Git - cc65/commitdiff
When preprocessing, all compares evaluate to constants, so don't print a
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 27 Aug 2009 22:09:46 +0000 (22:09 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 27 Aug 2009 22:09:46 +0000 (22:09 +0000)
warning in this case.

git-svn-id: svn://svn.cc65.org/cc65/trunk@4059 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/cc65/expr.c

index e8c962967b0084c2122985ad8865db006fe2657e..6c6268cc1f52d4c1606334a0a6832fc402ec4213 100644 (file)
@@ -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);