Many functions return useful values whether or not the function has side effects. In most cases, this value is used to signify whether the function successfully completed its task or if some error occurred. (See recommendation ERR02-C. Avoid in-band error indicators.) Other times, the value is the result of some computation and is an integral part of the function's API.
Wiki Markup |
Section 6.8.3 of C99 \ [[ISO/IEC 9899:1999|AA. Bibliography#ISO/IEC 9899-1999]\] states that
The expression in an expression statement is evaluated as a void
expression for its side effects.
...
Tool | Version | Checker | Description |
---|
| | | Section |
---|
Finds inconsistencies in how function call return values are handled. Coverity Prevent cannot discover all violations of this recommendation, so further verification is necessary. |
|
| | | |
| | | |
| | Section |
---|
SV.RVT.RETVAL_NOTTESTED |
| |
| | | Section |
---|
Fully Implemented |
|
| | | |
...