Versions Compared

Key

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

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 6.8.3 of the C standard Standard [ISO/IEC 9899:2011] states:

The expression in an expression statement is evaluated as a void expression for its side effects.

...

Tool

Version

Checker

Description

Coverity

Include Page
Coverity_V
Coverity_V

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.

Splint

Include Page
Splint_V
Splint_V

 

 

Compass/ROSE

 

 

 

Klocwork

Include Page
Klocwork_V
Klocwork_V

SV.RVT.RETVAL_NOTTESTED

 

LDRA tool suite

Include Page
LDRA_V
LDRA_V

382 S

Fully implemented.

ECLAIR

Include Page
ECLAIR_V
ECLAIR_V

ignrtrn

Fully implemented.

PRQA QA-C
Include Page
PRQA_V
PRQA_V
3200Fully implemented.

Related Vulnerabilities

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

Related Guidelines

...

...

...

...

...

Passing parameters and return values

...

...

...

Improper check for unusual or exceptional conditions

...

Bibliography

[ISO/IEC 9899:2011]Section 6.8.3, "Expression and Null Statements"

...