[metadata]
id = "FLP34-C"
type = "rule"
category = "FLP"
number = 34
title = "Ensure that floating-point conversions are within range of the new type"
description = """
If a floating-point value is to be converted to a floating-point value of a
smaller range and precision or to an integer type, or if an integer type is to
be converted to a floating-point type, the value must be representable in the
destination type.
The C Standard, 6.3.1.4, paragraph 2 [ISO/IEC 9899:2024], says,
Paragraph 2 of the same subclause says,
"""
severity = "Low"
likelihood = "Unlikely"
priority = "P3"
level = "L3"
cert_version = "2016 Edition (Wiki)"
last_modified = "Oct 29, 2025"
[rules.cert_c.FLP34-C]
enabled = true
[references]
wiki = "https://wiki.sei.cmu.edu/confluence/display/c/FLP34-C.+Ensure+that+floating-point+conversions+are+within+range+of+the+new+type"
cwe = ["CWE-681", "CWE-197", "CWE-195"]