-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathConversions.json
More file actions
162 lines (162 loc) · 5.99 KB
/
Copy pathConversions.json
File metadata and controls
162 lines (162 loc) · 5.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
{
"MISRA-C++-2023": {
"RULE-7-0-1": {
"properties": {
"enforcement": "decidable",
"obligation": "required"
},
"queries": [
{
"description": "Converting a bool type (implicitly or explicitly) to another type can lead to unintended behavior and code obfuscation, particularly when using bitwise operators instead of logical operators.",
"kind": "problem",
"name": "There shall be no conversion from type bool",
"precision": "very-high",
"severity": "error",
"short_name": "NoConversionFromBool",
"tags": [
"scope/single-translation-unit",
"maintainability",
"readability",
"correctness"
]
}
],
"title": "There shall be no conversion from type bool"
},
"RULE-7-0-2": {
"properties": {
"enforcement": "decidable",
"obligation": "required"
},
"queries": [
{
"description": "Implicit and contextual conversions to bool from fundamental types, unscoped enums, or pointers may lead to unintended behavior, except for specific cases like pointer checks and explicit operator bool conversions.",
"kind": "problem",
"name": "There shall be no conversion to type bool",
"precision": "very-high",
"severity": "error",
"short_name": "NoImplicitBoolConversion",
"tags": [
"scope/single-translation-unit",
"maintainability",
"readability",
"correctness"
]
}
],
"title": "There shall be no conversion to type bool"
},
"RULE-7-0-3": {
"properties": {
"enforcement": "decidable",
"obligation": "required"
},
"queries": [
{
"description": "Using the numerical value of a character type may lead to inconsistent behavior due to encoding dependencies and should be avoided in favor of safer C++ Standard Library functions.",
"kind": "problem",
"name": "The numerical value of a character shall not be used",
"precision": "very-high",
"severity": "error",
"short_name": "NoCharacterNumericalValue",
"tags": [
"scope/single-translation-unit",
"maintainability",
"readability"
]
}
],
"title": "The numerical value of a character shall not be used"
},
"RULE-7-0-4": {
"properties": {
"enforcement": "decidable",
"obligation": "required"
},
"queries": [
{
"description": "Bitwise and shift operators should only be applied to operands of appropriate types and values to avoid implementation-defined or undefined behavior.",
"kind": "problem",
"name": "The operands of bitwise operators and shift operators shall be appropriate",
"precision": "very-high",
"severity": "error",
"short_name": "InappropriateBitwiseOrShiftOperands",
"tags": [
"scope/single-translation-unit",
"correctness"
]
}
],
"title": "The operands of bitwise operators and shift operators shall be appropriate"
},
"RULE-7-0-5": {
"properties": {
"enforcement": "decidable",
"obligation": "required"
},
"queries": [
{
"description": "Integral promotion and usual arithmetic conversions that change operand signedness or type category may cause unexpected behavior or undefined behavior when operations overflow.",
"kind": "problem",
"name": "Integral promotion and the usual arithmetic conversions shall not change the signedness or the type",
"precision": "very-high",
"severity": "error",
"short_name": "NoSignednessChangeFromPromotion",
"tags": [
"scope/single-translation-unit",
"correctness",
"maintainability"
],
"implementation_scope": {
"description": "Arithmetic conversions in preprocessor directives are not supported."
}
}
],
"title": "Integral promotion and the usual arithmetic conversions shall not change the signedness or the type category of an operand"
},
"RULE-7-0-6": {
"properties": {
"enforcement": "decidable",
"obligation": "required"
},
"queries": [
{
"description": "Assignment between numeric types with different sizes, signedness, or type categories can lead to unexpected information loss, undefined behavior, or silent overload resolution changes.",
"kind": "problem",
"name": "Assignment between numeric types shall be appropriate",
"precision": "high",
"severity": "error",
"short_name": "NumericAssignmentTypeMismatch",
"tags": [
"scope/single-translation-unit",
"correctness",
"maintainability"
]
}
],
"title": "Assignment between numeric types shall be appropriate"
},
"RULE-7-11-3": {
"properties": {
"enforcement": "decidable",
"obligation": "required"
},
"queries": [
{
"description": "Converting a function type to a pointer-to-function type outside of static_cast or assignment to a pointer-to-function object creates ambiguous behavior and potential unintended effects.",
"kind": "problem",
"name": "A conversion from function type to pointer-to-function type shall only occur in appropriate contexts",
"precision": "very-high",
"severity": "error",
"short_name": "FunctionPointerConversionContext",
"tags": [
"scope/single-translation-unit",
"correctness",
"readability"
]
}
],
"title": "A conversion from function type to pointer-to-function type shall only occur in appropriate contexts"
}
}
}