Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Incorrect use of relational and equality operators can lead to incorrect control flow.

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

EXP13-C

Low

Unlikely

Medium

P2

L3

Automated Detection

Tool

Version

Checker

Description

ECLAIR

Include Page
ECLAIR_V
ECLAIR_V

CC2.EXP13

Fully implemented

GCC
Include Page
GCC_V
GCC_V

 


Option -Wparentheses warns if a comparison like x<=y<=z appears; this warning is also enabled by -Wall

LDRA tool suite
Include Page
LDRA_V
LDRA_V
433 SFully implemented
Polyspace Bug FinderR2016aPossibly unintended evaluation of expression because of operator precedence rules

Operator precedence rules cause unexpected evaluation order in arithmetic expression

PRQA QA-C
Include Page
PRQA QA-C_v
PRQA QA-C_v

3392
3401
4111
4112
4113

Fully implemented
PVS-Studio6.22V709General analysis rule

Related Guidelines

Bibliography

[ISO/IEC 9899:2011]Subclause 6.5.8, "Relational Operators"

...


...