This diagnostic message was added on users' request.
The analyzer allows you to detect some strange binary operations:
The V2007 diagnostic rule helps to perform code refactoring and sometimes detect errors.
These are examples of constructs that cause this diagnostic message to appear:
int X = 1 ^ 0; int Y = 2 / X;
This code can be simplified. For example:
int X = 1; int Y = 2;
To reduce the number of false positives, we have added several exceptions. For example, the V2007 diagnostic message is not generated when the strange expression is located inside a macro or is an array index.
According to Common Weakness Enumeration, potential errors found by using this diagnostic are classified as CWE-480.