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 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.
Section Subclause 6.8.3 of the C Standard [ISO/IEC 9899:2011] states:
...
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
|
|
| |||||||
| CHECKED_RETURN | Finds inconsistencies in how function call return values are handled. Coverity Prevent cannot discover all violations of this recommendation, so further verification is necessary | |||||||
| CC2.EXP12 | Fully implemented | |||||||
| SV.RVT.RETVAL_NOTTESTED |
| |||||||
| 382 S | Fully implemented | |||||||
PRQA QA-C |
| 3200 | Fully implemented | ||||||
|
|
|
...
Bibliography
[ISO/IEC 9899:2011] | Section Subclause 6.8.3, "Expression and Null Statements" |
...