The object representation for floating-point values is implementation defined. However, an implementation that defines the __STDC_IEC_559__
macro shall conform to the IEC 60559 floating-point standard and uses what is frequently referred to as IEEE 754 floating-point arithmetic [ISO/IEC 9899:20112024]. The floating-point object representation used by IEC 60559 is one of the most common floating-point object representations in use today.
...
Tool | Version | Checker | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Astrée |
| memcmp-with-float | Partially checked | ||||||||||||
Axivion Bauhaus Suite |
| CertC-FLP37 | Fully implemented | ||||||||||||
Cppcheck Premium |
| premium-cert-flp37-c | Fully implemented | ||||||||||||
Helix QAC |
| C5026 C++3118 | |||||||||||||
Klocwork |
| MISRA.STDLIB.MEMCMP.PTR_ARG_TYPES | |||||||||||||
LDRA tool suite |
| 618 S | Enhanced Enforcement | ||||||||||||
Parasoft C/C++test |
| CERT_C-FLP37- | ac | Avoid accessing arrays out of boundsDo not use object representations to compare floating-point values | |||||||||||
PC-lint Plus |
| 2498, 2499 | Fully supported | ||||||||||||
| Memory comparison of float-point values | Object representationCERT C: Rule FLP37-C | Checks for memory comparison of floating-point values | can be different (same) for equal (not equal) floating-point valuesPRQA QA-C | |||||||||||
Include Page | PRQA QA-C_v | PRQA QA-C_v | 5026(rule fully covered) | ||||||||||||
PVS-Studio |
| V1014 | |||||||||||||
RuleChecker |
| memcmp-with-float | Partially checked | ||||||||||||
TrustInSoft Analyzer |
| Exhaustively verified. |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Bibliography
[ISO/IEC 9899:20112024] | Annex F, "ISO/IEC 60559 floating-point arithmetic" |
...