The C99 standard defines modifying the result of a function call or accessing it after the next sequence point as undefined behavior.
The C standard The C11 standard [ISO/IEC 9899:2011] defines modifying an object with temporary lifetime results as undefined behavior. This differs from the C99 standard 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.
...
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Related Guidelines
ISO/IEC 9899:1999 Section 6.5.2.2, "Function calls"
ISO/IEC 9899:2011 Section 6.5.2.2, "Function calls"
...