You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
"title":"A virtual base class shall only be cast to a derived class by means of dynamic_cast"
23
+
},
24
+
"RULE-8-2-2": {
25
+
"properties": {
26
+
"enforcement":"decidable",
27
+
"obligation":"required"
28
+
},
29
+
"queries": [
30
+
{
31
+
"description":"Using C-style casts or functional notation casts allows unsafe type conversions and makes code harder to maintain compared to using named casts like const_cast, dynamic_cast, static_cast and reinterpret_cast.",
32
+
"kind":"problem",
33
+
"name":"C-style casts and functional notation casts shall not be used",
34
+
"precision":"very-high",
35
+
"severity":"error",
36
+
"short_name":"NoCStyleOrFunctionalCasts",
37
+
"tags": [
38
+
"scope/single-translation-unit"
39
+
]
40
+
}
41
+
],
42
+
"title":"C-style casts and functional notation casts shall not be used"
43
+
},
44
+
"RULE-8-2-6": {
45
+
"properties": {
46
+
"enforcement":"decidable",
47
+
"obligation":"required"
48
+
},
49
+
"queries": [
50
+
{
51
+
"description":"Casting from an integral type, enumerated type, or pointer to void type to a pointer type leads to unspecified behavior and is error prone.",
52
+
"kind":"problem",
53
+
"name":"An object with integral, enumerated, or pointer to void type shall not be cast to a pointer type",
54
+
"precision":"very-high",
55
+
"severity":"error",
56
+
"short_name":"IntToPointerCastProhibited",
57
+
"tags": [
58
+
"scope/single-translation-unit"
59
+
]
60
+
}
61
+
],
62
+
"title":"An object with integral, enumerated, or pointer to void type shall not be cast to a pointer type"
63
+
},
64
+
"RULE-8-2-7": {
65
+
"properties": {
66
+
"enforcement":"decidable",
67
+
"obligation":"advisory"
68
+
},
69
+
"queries": [
70
+
{
71
+
"description":"Casting between pointer types and integral types makes code behavior harder to understand and may cause pointer tracking tools to become unreliable.",
72
+
"kind":"problem",
73
+
"name":"A cast should not convert a pointer type to an integral type",
74
+
"precision":"very-high",
75
+
"severity":"error",
76
+
"short_name":"NoPointerToIntegralCast",
77
+
"tags": [
78
+
"scope/single-translation-unit"
79
+
]
80
+
}
81
+
],
82
+
"title":"A cast should not convert a pointer type to an integral type"
83
+
},
84
+
"RULE-8-2-8": {
85
+
"properties": {
86
+
"enforcement":"decidable",
87
+
"obligation":"required"
88
+
},
89
+
"queries": [
90
+
{
91
+
"description":"Casting object pointers to integral types other than std::uintptr_t or std::intptr_t can lead to implementation-defined behavior and potential loss of pointer information.",
92
+
"kind":"problem",
93
+
"name":"An object pointer type shall not be cast to an integral type other than std::uintptr_t or",
94
+
"precision":"very-high",
95
+
"severity":"error",
96
+
"short_name":"PointerToIntegralCast",
97
+
"tags": [
98
+
"scope/single-translation-unit"
99
+
]
100
+
}
101
+
],
102
+
"title":"An object pointer type shall not be cast to an integral type other than std::uintptr_t or std::intptr_t"
103
+
},
104
+
"RULE-9-2-1": {
105
+
"properties": {
106
+
"enforcement":"decidable",
107
+
"obligation":"required"
108
+
},
109
+
"queries": [
110
+
{
111
+
"description":"Using an explicit type conversion as an expression statement creates a temporary object that is immediately discarded, which can lead to unintended premature resource cleanup.",
112
+
"kind":"problem",
113
+
"name":"An explicit type conversion shall not be an expression statement",
114
+
"precision":"very-high",
115
+
"severity":"error",
116
+
"short_name":"NoStandaloneTypeCastExpression",
117
+
"tags": [
118
+
"scope/single-translation-unit"
119
+
]
120
+
}
121
+
],
122
+
"title":"An explicit type conversion shall not be an expression statement"