...
The expression a < b < c
evaluates to true rather than false, as its author probably intended, to false, and the expression a == b == c
evaluates to false rather than true, as its author probably intended, to true.
Compliant Solution
Treat relational and equality operators as if it were invalid to chain them.
...
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
GCC |
|
| Option | ||||||
| exprprns | Fully implemented. | |||||||
PRQA QA-C |
| 3392 | Fully implemented. |
Related Guidelines
...
Bibliography
...
] | Section 6.5.8 "Relational |
---|
...
Operators" |
---|
...