Versions Compared

Key

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

...

Code Block
enum { max = 15 };
int i = /* Initialize to user -supplied value */;

if ( (i >= 0) && ( (i++) <= max) ) {
  /* Code */
}

...

Code Block
bgColor#ffcccc
langc
char *p = /* Initialize,; may or may not be NULL */

if (p || (p = (char *) malloc(BUF_SIZE)) ) {
  /* Do stuff with p */
  free(p);
  p = NULL;
} else {
  /* Handle malloc() error */
  return;
}

...

Recommendation

Severity

Likelihood

Remediation Cost

Priority

Level

EXP02-C

lowLow

unlikelyUnlikely

mediumMedium

P2

L3

Automated Detection

Tool

Version

Checker

Description

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

LDRA tool suite

Include Page
LDRA_V
LDRA_V

35 D
1 Q
133 S
406 S
408 S

Fully implemented

PRQA QA-C
Include Page
PRQA_V
PRQA_V
3415Fully implemented

...