Skip to content

Commit c6ce829

Browse files
committed
EssentialTypes: Update metadata
1 parent cf12521 commit c6ce829

12 files changed

+110
-55
lines changed

c/misra/src/rules/RULE-10-1/OperandsOfAnInappropriateEssentialType.ql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
/**
22
* @id c/misra/operands-of-an-inappropriate-essential-type
33
* @name RULE-10-1: Operands shall not be of an inappropriate essential type
4-
* @description
4+
* @description Using an inappropriate essential type operand may lead to confusing or unexpected
5+
* behavior when the operand is converted.
56
* @kind problem
67
* @precision very-high
7-
* @problem.severity error
8+
* @problem.severity warning
89
* @tags external/misra/id/rule-10-1
10+
* maintainability
911
* external/misra/obligation/required
1012
*/
1113

c/misra/src/rules/RULE-10-1/PointerTypeOnLogicalOperator.ql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
/**
22
* @id c/misra/pointer-type-on-logical-operator
33
* @name RULE-10-1: Logical operators should not be used with pointer types
4-
* @description
4+
* @description Using pointer types with logical operators should be avoid because it can cause
5+
* confusing behavior.
56
* @kind problem
67
* @precision very-high
7-
* @problem.severity error
8+
* @problem.severity warning
89
* @tags external/misra/id/rule-10-1
10+
* correctness
911
* external/misra/obligation/required
1012
*/
1113

c/misra/src/rules/RULE-10-2/AdditionSubtractionOnEssentiallyCharType.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
/**
22
* @id c/misra/addition-subtraction-on-essentially-char-type
3-
* @name RULE-10-2: Expressions of essentially character type shall not be used inappropriately in addition and
3+
* @name RULE-10-2: Inappropriate use of essentially character type operands in addition and subtraction operations
44
* @description Expressions of essentially character type shall not be used inappropriately in
55
* addition and subtraction operations
66
* @kind problem
77
* @precision very-high
88
* @problem.severity error
99
* @tags external/misra/id/rule-10-2
10+
* maintainability
11+
* correctness
1012
* external/misra/obligation/required
1113
*/
1214

c/misra/src/rules/RULE-10-3/AssignmentOfIncompatibleEssentialType.ql

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
/**
22
* @id c/misra/assignment-of-incompatible-essential-type
3-
* @name RULE-10-3: The value of an expression shall not be assigned to an object with a narrower essential type or of a
3+
* @name RULE-10-3: Do not assign to an object with a different essential type category or narrower essential type
44
* @description The value of an expression shall not be assigned to an object with a narrower
55
* essential type or of a different essential type category
66
* @kind problem
7-
* @precision high
8-
* @problem.severity error
7+
* @precision very-high
8+
* @problem.severity warning
99
* @tags external/misra/id/rule-10-3
10+
* maintainability
11+
* correctness
1012
* external/misra/obligation/required
1113
*/
1214

c/misra/src/rules/RULE-10-4/OperandsWithMismatchedEssentialTypeCategory.ql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
/**
22
* @id c/misra/operands-with-mismatched-essential-type-category
3-
* @name RULE-10-4: Both operands of an operator in which the usual arithmetic conversions are performed shall have the
3+
* @name RULE-10-4: Operator with usual arithmetic conversions shall have operands with the same essential type category
44
* @description Both operands of an operator in which the usual arithmetic conversions are performed
55
* shall have the same essential type category
66
* @kind problem
77
* @precision very-high
8-
* @problem.severity error
8+
* @problem.severity warning
99
* @tags external/misra/id/rule-10-4
10+
* maintainability
11+
* correctness
1012
* external/misra/obligation/required
1113
*/
1214

c/misra/src/rules/RULE-10-5/InappropriateEssentialTypeCast.ql

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
/**
22
* @id c/misra/inappropriate-essential-type-cast
33
* @name RULE-10-5: The value of an expression should not be cast to an inappropriate essential type
4-
* @description
4+
* @description Casting the value of an expression to an inappropriate essential type may lead to
5+
* confusing or unexpected behavior in the way the value is converted.
56
* @kind problem
67
* @precision very-high
7-
* @problem.severity error
8+
* @problem.severity warning
89
* @tags external/misra/id/rule-10-5
10+
* maintainability
11+
* correctness
912
* external/misra/obligation/advisory
1013
*/
1114

c/misra/src/rules/RULE-10-6/AssignmentToWiderEssentialType.ql

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
/**
22
* @id c/misra/assignment-to-wider-essential-type
33
* @name RULE-10-6: The value of a composite expression shall not be assigned to an object with wider essential type
4-
* @description
4+
* @description Assigning a composite expression to an object with wider essential type can cause
5+
* some unexpected conversions.
56
* @kind problem
67
* @precision very-high
7-
* @problem.severity error
8+
* @problem.severity warning
89
* @tags external/misra/id/rule-10-6
10+
* maintainability
11+
* correctness
912
* external/misra/obligation/required
1013
*/
1114

c/misra/src/rules/RULE-10-7/ImplicitConversionOfCompositeExpression.ql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
/**
22
* @id c/misra/implicit-conversion-of-composite-expression
3-
* @name RULE-10-7: If a composite expression is used as one operand of an operator in which the usual arithmetic
3+
* @name RULE-10-7: Implicit conversion of composite expression operand to wider essential type
44
* @description If a composite expression is used as one operand of an operator in which the usual
55
* arithmetic conversions are performed then the other operand shall not have wider
66
* essential type
77
* @kind problem
88
* @precision very-high
9-
* @problem.severity error
9+
* @problem.severity warning
1010
* @tags external/misra/id/rule-10-7
11+
* maintainability
12+
* correctness
1113
* external/misra/obligation/required
1214
*/
1315

c/misra/src/rules/RULE-10-8/InappropriateCastOfCompositeExpression.ql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
/**
22
* @id c/misra/inappropriate-cast-of-composite-expression
3-
* @name RULE-10-8: The value of a composite expression shall not be cast to a different essential type category or a
3+
* @name RULE-10-8: Composite expression explicitly casted to wider or different essential type
44
* @description The value of a composite expression shall not be cast to a different essential type
55
* category or a wider essential type
66
* @kind problem
77
* @precision very-high
8-
* @problem.severity error
8+
* @problem.severity warning
99
* @tags external/misra/id/rule-10-8
10+
* maintainability
11+
* correctness
1012
* external/misra/obligation/required
1113
*/
1214

c/misra/src/rules/RULE-14-1/LoopOverEssentiallyFloatType.ql

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
/**
22
* @id c/misra/loop-over-essentially-float-type
33
* @name RULE-14-1: A loop counter shall not have essentially floating type
4-
* @description
4+
* @description A floating point loop counter can cause confusing behavior when incremented.
55
* @kind problem
6-
* @precision high
7-
* @problem.severity error
6+
* @precision very-high
7+
* @problem.severity warning
88
* @tags external/misra/id/rule-14-1
9+
* maintainability
10+
* correctness
911
* external/misra/obligation/required
1012
*/
1113

c/misra/src/rules/RULE-21-16/MemcmpOnInappropriateEssentialTypeArgs.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
/**
22
* @id c/misra/memcmp-on-inappropriate-essential-type-args
3-
* @name RULE-21-16: The pointer arguments to the Standard Library function memcmp shall point to either a pointer type,
3+
* @name RULE-21-16: Do not use memcmp on pointers to characters or composite types such as structs and unions.
44
* @description The pointer arguments to the Standard Library function memcmp shall point to either
55
* a pointer type, an essentially signed type, an essentially unsigned type, an
66
* essentially Boolean type or an essentially enum type
77
* @kind problem
88
* @precision very-high
99
* @problem.severity error
1010
* @tags external/misra/id/rule-21-16
11+
* maintainability
12+
* correctness
1113
* external/misra/obligation/required
1214
*/
1315

rule_packages/c/EssentialTypes.json

Lines changed: 64 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,26 @@
66
},
77
"queries": [
88
{
9-
"description": "",
9+
"description": "Using an inappropriate essential type operand may lead to confusing or unexpected behavior when the operand is converted.",
1010
"kind": "problem",
1111
"name": "Operands shall not be of an inappropriate essential type",
1212
"precision": "very-high",
13-
"severity": "error",
13+
"severity": "warning",
1414
"short_name": "OperandsOfAnInappropriateEssentialType",
15-
"tags": []
15+
"tags": [
16+
"maintainability"
17+
]
1618
},
1719
{
18-
"description": "",
20+
"description": "Using pointer types with logical operators should be avoid because it can cause confusing behavior.",
1921
"kind": "problem",
2022
"name": "Logical operators should not be used with pointer types",
2123
"precision": "very-high",
22-
"severity": "error",
24+
"severity": "warning",
2325
"short_name": "PointerTypeOnLogicalOperator",
24-
"tags": []
26+
"tags": [
27+
"correctness"
28+
]
2529
}
2630
],
2731
"title": "Operands shall not be of an inappropriate essential type"
@@ -34,11 +38,14 @@
3438
{
3539
"description": "Expressions of essentially character type shall not be used inappropriately in addition and subtraction operations",
3640
"kind": "problem",
37-
"name": "Expressions of essentially character type shall not be used inappropriately in addition and",
41+
"name": "Inappropriate use of essentially character type operands in addition and subtraction operations",
3842
"precision": "very-high",
3943
"severity": "error",
4044
"short_name": "AdditionSubtractionOnEssentiallyCharType",
41-
"tags": []
45+
"tags": [
46+
"maintainability",
47+
"correctness"
48+
]
4249
}
4350
],
4451
"title": "Expressions of essentially character type shall not be used inappropriately in addition and subtraction operations"
@@ -51,11 +58,14 @@
5158
{
5259
"description": "The value of an expression shall not be assigned to an object with a narrower essential type or of a different essential type category",
5360
"kind": "problem",
54-
"name": "The value of an expression shall not be assigned to an object with a narrower essential type or of a",
55-
"precision": "high",
56-
"severity": "error",
61+
"name": "Do not assign to an object with a different essential type category or narrower essential type",
62+
"precision": "very-high",
63+
"severity": "warning",
5764
"short_name": "AssignmentOfIncompatibleEssentialType",
58-
"tags": []
65+
"tags": [
66+
"maintainability",
67+
"correctness"
68+
]
5969
}
6070
],
6171
"title": "The value of an expression shall not be assigned to an object with a narrower essential type or of a different essential type category"
@@ -68,11 +78,14 @@
6878
{
6979
"description": "Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category",
7080
"kind": "problem",
71-
"name": "Both operands of an operator in which the usual arithmetic conversions are performed shall have the",
81+
"name": "Operator with usual arithmetic conversions shall have operands with the same essential type category",
7282
"precision": "very-high",
73-
"severity": "error",
83+
"severity": "warning",
7484
"short_name": "OperandsWithMismatchedEssentialTypeCategory",
75-
"tags": []
85+
"tags": [
86+
"maintainability",
87+
"correctness"
88+
]
7689
}
7790
],
7891
"title": "Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category"
@@ -83,13 +96,16 @@
8396
},
8497
"queries": [
8598
{
86-
"description": "",
99+
"description": "Casting the value of an expression to an inappropriate essential type may lead to confusing or unexpected behavior in the way the value is converted.",
87100
"kind": "problem",
88101
"name": "The value of an expression should not be cast to an inappropriate essential type",
89102
"precision": "very-high",
90-
"severity": "error",
103+
"severity": "warning",
91104
"short_name": "InappropriateEssentialTypeCast",
92-
"tags": []
105+
"tags": [
106+
"maintainability",
107+
"correctness"
108+
]
93109
}
94110
],
95111
"title": "The value of an expression should not be cast to an inappropriate essential type"
@@ -100,13 +116,16 @@
100116
},
101117
"queries": [
102118
{
103-
"description": "",
119+
"description": "Assigning a composite expression to an object with wider essential type can cause some unexpected conversions.",
104120
"kind": "problem",
105121
"name": "The value of a composite expression shall not be assigned to an object with wider essential type",
106122
"precision": "very-high",
107-
"severity": "error",
123+
"severity": "warning",
108124
"short_name": "AssignmentToWiderEssentialType",
109-
"tags": []
125+
"tags": [
126+
"maintainability",
127+
"correctness"
128+
]
110129
}
111130
],
112131
"title": "The value of a composite expression shall not be assigned to an object with wider essential type"
@@ -119,11 +138,14 @@
119138
{
120139
"description": "If a composite expression is used as one operand of an operator in which the usual arithmetic conversions are performed then the other operand shall not have wider essential type",
121140
"kind": "problem",
122-
"name": "If a composite expression is used as one operand of an operator in which the usual arithmetic",
141+
"name": "Implicit conversion of composite expression operand to wider essential type",
123142
"precision": "very-high",
124-
"severity": "error",
143+
"severity": "warning",
125144
"short_name": "ImplicitConversionOfCompositeExpression",
126-
"tags": []
145+
"tags": [
146+
"maintainability",
147+
"correctness"
148+
]
127149
}
128150
],
129151
"title": "If a composite expression is used as one operand of an operator in which the usual arithmetic conversions are performed then the other operand shall not have wider essential type"
@@ -136,11 +158,14 @@
136158
{
137159
"description": "The value of a composite expression shall not be cast to a different essential type category or a wider essential type",
138160
"kind": "problem",
139-
"name": "The value of a composite expression shall not be cast to a different essential type category or a",
161+
"name": "Composite expression explicitly casted to wider or different essential type",
140162
"precision": "very-high",
141-
"severity": "error",
163+
"severity": "warning",
142164
"short_name": "InappropriateCastOfCompositeExpression",
143-
"tags": []
165+
"tags": [
166+
"maintainability",
167+
"correctness"
168+
]
144169
}
145170
],
146171
"title": "The value of a composite expression shall not be cast to a different essential type category or a wider essential type"
@@ -151,13 +176,16 @@
151176
},
152177
"queries": [
153178
{
154-
"description": "",
179+
"description": "A floating point loop counter can cause confusing behavior when incremented.",
155180
"kind": "problem",
156181
"name": "A loop counter shall not have essentially floating type",
157-
"precision": "high",
158-
"severity": "error",
182+
"precision": "very-high",
183+
"severity": "warning",
159184
"short_name": "LoopOverEssentiallyFloatType",
160-
"tags": []
185+
"tags": [
186+
"maintainability",
187+
"correctness"
188+
]
161189
}
162190
],
163191
"title": "A loop counter shall not have essentially floating type"
@@ -170,11 +198,14 @@
170198
{
171199
"description": "The pointer arguments to the Standard Library function memcmp shall point to either a pointer type, an essentially signed type, an essentially unsigned type, an essentially Boolean type or an essentially enum type",
172200
"kind": "problem",
173-
"name": "The pointer arguments to the Standard Library function memcmp shall point to either a pointer type,",
201+
"name": "Do not use memcmp on pointers to characters or composite types such as structs and unions.",
174202
"precision": "very-high",
175203
"severity": "error",
176204
"short_name": "MemcmpOnInappropriateEssentialTypeArgs",
177-
"tags": []
205+
"tags": [
206+
"maintainability",
207+
"correctness"
208+
]
178209
}
179210
],
180211
"title": "The pointer arguments to the Standard Library function memcmp shall point to either a pointer type, an essentially signed type, an essentially unsigned type, an essentially Boolean type or an essentially enum type"

0 commit comments

Comments
 (0)