The analyzer has detected a code fragment that may contain a logical error: operands of an operator are equivalent.
The example:
if (a != 0 && a != 0)
In this case, the identical expressions a != 0 surround the && operator, which indicates an unintended error. Most likely, another variable should be checked:
if (a != 0 && b != 0)
The second check may also be redundant.
The diagnostic rule also considers non-identical but equivalent expressions.
The example:
if ((a * b) > (b * a))
The analyzer reports a warning because multiplication is commutative, and the expressions will evaluate to the same result.
You can look at examples of errors detected by the V7001 diagnostic. |
Was this page helpful?
Your message has been sent. We will email you at
If you do not see the email in your inbox, please check if it is filtered to one of the following folders: