Added a warning if the result of a compare operation is constant. This should
protect against missing parenthesis like in (si & 0x7F == 0). Hopefully without too many false positives. git-svn-id: svn://svn.cc65.org/cc65/trunk@4057 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -1885,6 +1885,8 @@ static void hie_compare (const GenDesc* Ops, /* List of generators */
|
|||||||
/* Check for const operands */
|
/* Check for const operands */
|
||||||
if (ED_IsConstAbs (Expr) && rconst) {
|
if (ED_IsConstAbs (Expr) && rconst) {
|
||||||
|
|
||||||
|
Warning ("Result of comparison is constant");
|
||||||
|
|
||||||
/* Both operands are constant, remove the generated code */
|
/* Both operands are constant, remove the generated code */
|
||||||
RemoveCode (&Mark1);
|
RemoveCode (&Mark1);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user