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

Astrée
Include Page
Astrée_V
Astrée_V
chained-comparisonFully checked

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

Helix QAC

Include Page
Helix QAC_V
Helix QAC_V

C3392, C3401, C4111, C4112, C4113


LDRA tool suite
Include Page
LDRA_V
LDRA_V
433 SFully implemented
PC-lint Plus

Include Page
PC-lint Plus_V
PC-lint Plus_V

503, 731

Fully supported

Polyspace Bug Finder
R2016a

Include Page
Polyspace Bug Finder_V
Polyspace Bug Finder_V

CERT C: Rec. EXP13-CChecks for possibly
Possibly
unintended evaluation of expression because of operator precedence rules

Operator precedence rules cause unexpected evaluation order in arithmetic expression

PRQA QA-C
(rec. fully covered)


PVS-Studio

Include Page

PRQA QA

PVS-

C

Studio_

v

V

PRQA QA

PVS-

C

Studio_

v

V

V709
3392

RuleChecker
3401
Include Page
4111
4112
4113
RuleChecker_V
RuleChecker_V
chained-comparisonFully checked
Fully implemented

Related Guidelines

Bibliography

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

...


...