Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: updated font

...

Failing to understand the short-circuit behavior of the logical OR or AND operator may cause unintended program behavior.

Recommendation

Severity

Likelihood

Remediation Cost

Priority

Level

EXP02-C

Low

Unlikely

Medium

P2

L3

Automated Detection

Tool

Version

Checker

Description

Astrée
Include Page
Astrée_V
Astrée_V
logop-side-effectFully checked
Compass/ROSE

 

 



Could detect possible violations of this recommendation by reporting expressions with side effects, including function calls, that appear on the right-hand side of an && or || operator

Klocwork
Include Page
Klocwork_V
Klocwork_V
MISRA.LOGIC.SIDEEFF
 

LDRA tool suite
Include Page
LDRA_V
LDRA_V

35 D
1 Q
133 S
406 S
408 S

Fully implemented

Parasoft C/C++test
Include Page
c:
Parasoft_V
c:
Parasoft_V
MISRA2004-12_4aFully implemented
PRQA QA-C
Include Page
PRQA QA-C_v
PRQA QA-C_v
3415Fully implemented
RuleChecker
Include Page
RuleChecker_V
RuleChecker_V
logop-side-effectFully checked
SonarQube C/C++ Plugin
Include Page
SonarQube C/C++ Plugin_V
SonarQube C/C++ Plugin_V
SideEffectInRightHandSideOfLogical
 

Related Vulnerabilities

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

Related Guidelines

...


...