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.
...
Tool | Version | Checker | Description | Splint | |||||
|---|---|---|---|---|---|---|---|---|---|
| Include Page | Splint_V |
|
| ||||||
GCC |
|
| Can detect violations of this rule when the | ||||||
Splint |
|
|
|
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
...
| ISO/IEC TR 24772 | Dangling references to stack frames [DCM] and Side-effects and order of evaluation [SAM] |
|---|
Bibliography
...