
...
Although the standard does not require narrowing return expressions of the same type as the function, it does not clearly state what is allowed. Is it allowed to narrow the result? Is it allowed to narrow the result sometimes but not always? Is it allowed to partially narrow the result (for example, if the application binary interface [ABI] returns floats in double format, but a float function has a float return expression evaluated to wider than double)? An aggressive implementation could argue yes yes€ to all these questions, though the resulting behavior would complicate debugging and error analysis.
...
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
FLP07-C | Low | Probable | Medium | P4 | L3 |
Automated Detection
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
Axivion Bauhaus Suite |
| CertC-FLP07 | |||||||
Klocwork |
| CERT.RTN.FLT.CAST.DBL CERT.RTN.FLT.IMPLICIT.CAST.DBL |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
...