Versions Compared

Key

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

...

Code Block
bgColor#ccccff
j = i++;
func(j, i);

Risk Assessment

Attempting to modify an object multiple times between sequence points may cause that object to take on an unexpected value. This can lead to unexpected program behavior.

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

EXP30-C

medium

probable

medium

P8

L2

Automated Detection

Splint Version 3.1.1 can detect violations of this rule.

GCC Compiler cat detect violations of this rule when the -Wsequence-point flag is used.

Compass/ROSE can detect simple violations of this rule. It needs to examine each expression and make sure that no variable is modified twice in the expression. Also no variable is modified once, and read elsewhere, with the single exception that a variable may appear on both the left and right of an assignment operator.

Risk Assessment

Attempting to modify an object multiple times between sequence points may cause that object to take on an unexpected value. This can lead to unexpected program behavior.

...

Rule

...

Severity

...

Likelihood

...

Remediation Cost

...

Priority

...

Level

...

EXP30-C

...

medium

...

probable

...

medium

...

P8

...

Related Vulnerabilities

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

...