Skip to content

Commit 2696718

Browse files
committed
WIP: Add basic EssentialTypes library
1 parent a53e650 commit 2696718

File tree

1 file changed

+180
-0
lines changed

1 file changed

+180
-0
lines changed
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
//** THIS FILE IS AUTOGENERATED, DO NOT MODIFY DIRECTLY. **/
2+
import cpp
3+
import RuleMetadata
4+
import codingstandards.cpp.exclusions.RuleMetadata
5+
6+
newtype EssentialTypesQuery =
7+
TOperandsOfAnInappropriateEssentialTypeQuery() or
8+
TAdditionSubtractionOnEssentiallyCharTypeQuery() or
9+
TAssignmentOfIncompatibleEssentialTypeQuery() or
10+
TOperandsWithMismatchedEssentialTypeCategoryQuery() or
11+
TInappropriateEssentialTypeCastQuery() or
12+
TAssignmentToWiderEssentialTypeQuery() or
13+
TImplicitConversionOfCompositeExpressionQuery() or
14+
TInappropriateCastOfCompositeExpressionQuery() or
15+
TLoopOverEssentiallyFloatTypeQuery() or
16+
TMemcmpOnInappropriateEssentialTypeArgsQuery()
17+
18+
predicate isEssentialTypesQueryMetadata(Query query, string queryId, string ruleId, string category) {
19+
query =
20+
// `Query` instance for the `operandsOfAnInappropriateEssentialType` query
21+
EssentialTypesPackage::operandsOfAnInappropriateEssentialTypeQuery() and
22+
queryId =
23+
// `@id` for the `operandsOfAnInappropriateEssentialType` query
24+
"c/misra/operands-of-an-inappropriate-essential-type" and
25+
ruleId = "RULE-10-1" and
26+
category = "required"
27+
or
28+
query =
29+
// `Query` instance for the `additionSubtractionOnEssentiallyCharType` query
30+
EssentialTypesPackage::additionSubtractionOnEssentiallyCharTypeQuery() and
31+
queryId =
32+
// `@id` for the `additionSubtractionOnEssentiallyCharType` query
33+
"c/misra/addition-subtraction-on-essentially-char-type" and
34+
ruleId = "RULE-10-2" and
35+
category = "required"
36+
or
37+
query =
38+
// `Query` instance for the `assignmentOfIncompatibleEssentialType` query
39+
EssentialTypesPackage::assignmentOfIncompatibleEssentialTypeQuery() and
40+
queryId =
41+
// `@id` for the `assignmentOfIncompatibleEssentialType` query
42+
"c/misra/assignment-of-incompatible-essential-type" and
43+
ruleId = "RULE-10-3" and
44+
category = "required"
45+
or
46+
query =
47+
// `Query` instance for the `operandsWithMismatchedEssentialTypeCategory` query
48+
EssentialTypesPackage::operandsWithMismatchedEssentialTypeCategoryQuery() and
49+
queryId =
50+
// `@id` for the `operandsWithMismatchedEssentialTypeCategory` query
51+
"c/misra/operands-with-mismatched-essential-type-category" and
52+
ruleId = "RULE-10-4" and
53+
category = "required"
54+
or
55+
query =
56+
// `Query` instance for the `inappropriateEssentialTypeCast` query
57+
EssentialTypesPackage::inappropriateEssentialTypeCastQuery() and
58+
queryId =
59+
// `@id` for the `inappropriateEssentialTypeCast` query
60+
"c/misra/inappropriate-essential-type-cast" and
61+
ruleId = "RULE-10-5" and
62+
category = "advisory"
63+
or
64+
query =
65+
// `Query` instance for the `assignmentToWiderEssentialType` query
66+
EssentialTypesPackage::assignmentToWiderEssentialTypeQuery() and
67+
queryId =
68+
// `@id` for the `assignmentToWiderEssentialType` query
69+
"c/misra/assignment-to-wider-essential-type" and
70+
ruleId = "RULE-10-6" and
71+
category = "required"
72+
or
73+
query =
74+
// `Query` instance for the `implicitConversionOfCompositeExpression` query
75+
EssentialTypesPackage::implicitConversionOfCompositeExpressionQuery() and
76+
queryId =
77+
// `@id` for the `implicitConversionOfCompositeExpression` query
78+
"c/misra/implicit-conversion-of-composite-expression" and
79+
ruleId = "RULE-10-7" and
80+
category = "required"
81+
or
82+
query =
83+
// `Query` instance for the `inappropriateCastOfCompositeExpression` query
84+
EssentialTypesPackage::inappropriateCastOfCompositeExpressionQuery() and
85+
queryId =
86+
// `@id` for the `inappropriateCastOfCompositeExpression` query
87+
"c/misra/inappropriate-cast-of-composite-expression" and
88+
ruleId = "RULE-10-8" and
89+
category = "required"
90+
or
91+
query =
92+
// `Query` instance for the `loopOverEssentiallyFloatType` query
93+
EssentialTypesPackage::loopOverEssentiallyFloatTypeQuery() and
94+
queryId =
95+
// `@id` for the `loopOverEssentiallyFloatType` query
96+
"c/misra/loop-over-essentially-float-type" and
97+
ruleId = "RULE-14-1" and
98+
category = "required"
99+
or
100+
query =
101+
// `Query` instance for the `memcmpOnInappropriateEssentialTypeArgs` query
102+
EssentialTypesPackage::memcmpOnInappropriateEssentialTypeArgsQuery() and
103+
queryId =
104+
// `@id` for the `memcmpOnInappropriateEssentialTypeArgs` query
105+
"c/misra/memcmp-on-inappropriate-essential-type-args" and
106+
ruleId = "RULE-21-16" and
107+
category = "required"
108+
}
109+
110+
module EssentialTypesPackage {
111+
Query operandsOfAnInappropriateEssentialTypeQuery() {
112+
//autogenerate `Query` type
113+
result =
114+
// `Query` type for `operandsOfAnInappropriateEssentialType` query
115+
TQueryC(TEssentialTypesPackageQuery(TOperandsOfAnInappropriateEssentialTypeQuery()))
116+
}
117+
118+
Query additionSubtractionOnEssentiallyCharTypeQuery() {
119+
//autogenerate `Query` type
120+
result =
121+
// `Query` type for `additionSubtractionOnEssentiallyCharType` query
122+
TQueryC(TEssentialTypesPackageQuery(TAdditionSubtractionOnEssentiallyCharTypeQuery()))
123+
}
124+
125+
Query assignmentOfIncompatibleEssentialTypeQuery() {
126+
//autogenerate `Query` type
127+
result =
128+
// `Query` type for `assignmentOfIncompatibleEssentialType` query
129+
TQueryC(TEssentialTypesPackageQuery(TAssignmentOfIncompatibleEssentialTypeQuery()))
130+
}
131+
132+
Query operandsWithMismatchedEssentialTypeCategoryQuery() {
133+
//autogenerate `Query` type
134+
result =
135+
// `Query` type for `operandsWithMismatchedEssentialTypeCategory` query
136+
TQueryC(TEssentialTypesPackageQuery(TOperandsWithMismatchedEssentialTypeCategoryQuery()))
137+
}
138+
139+
Query inappropriateEssentialTypeCastQuery() {
140+
//autogenerate `Query` type
141+
result =
142+
// `Query` type for `inappropriateEssentialTypeCast` query
143+
TQueryC(TEssentialTypesPackageQuery(TInappropriateEssentialTypeCastQuery()))
144+
}
145+
146+
Query assignmentToWiderEssentialTypeQuery() {
147+
//autogenerate `Query` type
148+
result =
149+
// `Query` type for `assignmentToWiderEssentialType` query
150+
TQueryC(TEssentialTypesPackageQuery(TAssignmentToWiderEssentialTypeQuery()))
151+
}
152+
153+
Query implicitConversionOfCompositeExpressionQuery() {
154+
//autogenerate `Query` type
155+
result =
156+
// `Query` type for `implicitConversionOfCompositeExpression` query
157+
TQueryC(TEssentialTypesPackageQuery(TImplicitConversionOfCompositeExpressionQuery()))
158+
}
159+
160+
Query inappropriateCastOfCompositeExpressionQuery() {
161+
//autogenerate `Query` type
162+
result =
163+
// `Query` type for `inappropriateCastOfCompositeExpression` query
164+
TQueryC(TEssentialTypesPackageQuery(TInappropriateCastOfCompositeExpressionQuery()))
165+
}
166+
167+
Query loopOverEssentiallyFloatTypeQuery() {
168+
//autogenerate `Query` type
169+
result =
170+
// `Query` type for `loopOverEssentiallyFloatType` query
171+
TQueryC(TEssentialTypesPackageQuery(TLoopOverEssentiallyFloatTypeQuery()))
172+
}
173+
174+
Query memcmpOnInappropriateEssentialTypeArgsQuery() {
175+
//autogenerate `Query` type
176+
result =
177+
// `Query` type for `memcmpOnInappropriateEssentialTypeArgs` query
178+
TQueryC(TEssentialTypesPackageQuery(TMemcmpOnInappropriateEssentialTypeArgsQuery()))
179+
}
180+
}

0 commit comments

Comments
 (0)