Skip to content

Commit fbc7c89

Browse files
committed
FloatingTypes: Improve descriptions
1 parent 3d09627 commit fbc7c89

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

c/cert/src/rules/FLP34-C/UncheckedFloatingPointConversion.ql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/**
22
* @id c/cert/unchecked-floating-point-conversion
33
* @name FLP34-C: Ensure that floating-point conversions are within range of the new type
4-
* @description
4+
* @description Conversions of out-of-range floating-point values to integral types can lead to
5+
* undefined behavior.
56
* @kind problem
6-
* @precision very-high
7+
* @precision high
78
* @problem.severity error
89
* @tags external/cert/id/flp34-c
910
* correctness

c/cert/src/rules/FLP36-C/IntToFloatPreservePrecision.ql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/**
22
* @id c/cert/int-to-float-preserve-precision
33
* @name FLP36-C: Preserve precision when converting integral values to floating-point type
4-
* @description
4+
* @description Integer to floating-point conversions may lose precision if the floating-point type
5+
* is unable to fully represent the integer value.
56
* @kind problem
6-
* @precision very-high
7+
* @precision high
78
* @problem.severity error
89
* @tags external/cert/id/flp36-c
910
* correctness

c/cert/src/rules/FLP37-C/MemcmpUsedToCompareFloats.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/**
22
* @id c/cert/memcmp-used-to-compare-floats
33
* @name FLP37-C: Do not use object representations to compare floating-point values
4-
* @description
4+
* @description Comparing floating point values using the memcmp can lead to unexpected comparison
5+
* failures as equivalent floating-point values may not have the same bit pattern.
56
* @kind problem
67
* @precision very-high
78
* @problem.severity error

rule_packages/c/FloatingTypes.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
},
2727
"queries": [
2828
{
29-
"description": "",
29+
"description": "Conversions of out-of-range floating-point values to integral types can lead to undefined behavior.",
3030
"kind": "problem",
3131
"name": "Ensure that floating-point conversions are within range of the new type",
32-
"precision": "very-high",
32+
"precision": "high",
3333
"severity": "error",
3434
"short_name": "UncheckedFloatingPointConversion",
3535
"tags": [
@@ -45,10 +45,10 @@
4545
},
4646
"queries": [
4747
{
48-
"description": "",
48+
"description": "Integer to floating-point conversions may lose precision if the floating-point type is unable to fully represent the integer value.",
4949
"kind": "problem",
5050
"name": "Preserve precision when converting integral values to floating-point type",
51-
"precision": "very-high",
51+
"precision": "high",
5252
"severity": "error",
5353
"short_name": "IntToFloatPreservePrecision",
5454
"tags": [
@@ -64,7 +64,7 @@
6464
},
6565
"queries": [
6666
{
67-
"description": "",
67+
"description": "Comparing floating point values using the memcmp can lead to unexpected comparison failures as equivalent floating-point values may not have the same bit pattern.",
6868
"kind": "problem",
6969
"name": "Do not use object representations to compare floating-point values",
7070
"precision": "very-high",

0 commit comments

Comments
 (0)