Versions Compared

Key

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

The C Standard [ISO/IEC 9899:2011] Standard defines modifying an object with temporary lifetime results as undefined behavior. This definition differs from the C99 Standard (which defines modifying the result of a function call or accessing it after the next sequence point as undefined behavior) because a temporary object's lifetime ends when the evaluation containing the full expression or full declarator ends, so the result of a function call can be accessed.

...

Note that the behavior of this code in the C Standard [ISO/IEC 9899:2011] is defined, because the lifetime of temporary objects extends to the full expression containing it.

...

Splint_V

Tool

Version

Checker

Description

Splint

Include Page

Splint_V

 

 

GCC

Include Page
GCC_V
GCC_V

 

Can detect violations of this rule when the -Wall flag is used.

Splint

Include Page
Splint_V
Splint_V

 

 

Related Vulnerabilities

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

...

ISO/IEC TR 24772Dangling references to stack frames [DCM] and
Side-effects and order of evaluation [SAM]

Bibliography

...