-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathSideEffects1.json
More file actions
188 lines (188 loc) · 7.31 KB
/
SideEffects1.json
File metadata and controls
188 lines (188 loc) · 7.31 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
{
"CERT-C": {
"EXP30-C": {
"properties": {
"obligation": "rule"
},
"queries": [
{
"description": "Depending on the order of evaluation for side effects for evaluation of scalar objects that are unsequenced results in undefined behavior.",
"kind": "problem",
"name": "Do not depend on the order of scalar object evaluation for side effects",
"precision": "high",
"severity": "warning",
"short_name": "DependenceOnOrderOfScalarEvaluationForSideEffects",
"tags": [
"correctness"
]
},
{
"description": "Depending on the order of evaluation for side effects in function call arguments can result in unexpected program behavior.",
"kind": "problem",
"name": "Do not depend on the order of evaluation of function call arguments for side effects",
"precision": "high",
"severity": "warning",
"short_name": "DependenceOnOrderOfFunctionArgumentsForSideEffects",
"tags": [
"correctness"
]
}
],
"title": "Do not depend on the order of evaluation for side effects"
},
"EXP44-C": {
"properties": {
"obligation": "rule"
},
"queries": [
{
"description": "The operands to sizeof, _Alignof, or _Generic are not evaluated and their side effect will not be generated. Using operands with a side effect can result in unexpected program behavior.",
"kind": "problem",
"name": "Do not rely on side effects in operands to sizeof, _Alignof, or _Generic",
"precision": "very-high",
"severity": "error",
"short_name": "UnevaluatedOperandWithSideEffect",
"tags": [
"correctness"
]
}
],
"title": "Do not rely on side effects in operands to sizeof, _Alignof, or _Generic"
},
"EXP45-C": {
"properties": {
"obligation": "rule"
},
"queries": [
{
"description": "Assignments in selection statements is indicative of a programmer error and can result in unexpected program behavior.",
"kind": "problem",
"name": "Do not perform assignments in selection statements",
"precision": "very-high",
"severity": "error",
"short_name": "AssignmentsInSelectionStatements",
"tags": [
"correctness"
]
}
],
"title": "Do not perform assignments in selection statements"
}
},
"MISRA-C-2012": {
"RULE-12-1": {
"properties": {
"obligation": "advisory"
},
"queries": [
{
"description": "The relative precedences of operators are not intuitive and can lead to mistakes. The use of parentheses to make the precedence of operators explicit removes the possibility of incorrect expectations.",
"kind": "problem",
"name": "The operand of the sizeof operator should be enclosed in parentheses",
"precision": "very-high",
"severity": "warning",
"short_name": "UnenclosedSizeofOperand",
"tags": [
"correctness",
"external/misra/c/2012/third-edition-first-revision"
]
},
{
"description": "The relative precedences of operators are not intuitive and can lead to mistakes. The use of parentheses to make the precedence of operators explicit removes the possibility of incorrect expectations.",
"kind": "problem",
"name": "The precedence of operators within expressions should be made explicit",
"precision": "very-high",
"severity": "warning",
"short_name": "ImplicitPrecedenceOfOperatorsInExpression",
"tags": [
"correctness",
"external/misra/c/2012/third-edition-first-revision"
]
}
],
"title": "The precedence of operators within expressions should be made explicit"
},
"RULE-13-1": {
"properties": {
"obligation": "required"
},
"queries": [
{
"description": "The order in which side effects occur during the evaluation of the expressions in an initializer list is unspecified and can result in unexpected program behavior.",
"kind": "problem",
"name": "Initializer lists shall not contain persistent side effects",
"precision": "very-high",
"severity": "error",
"short_name": "InitializerListsContainPersistentSideEffects",
"tags": [
"correctness",
"external/misra/c/2012/third-edition-first-revision"
]
}
],
"title": "Initializer lists shall not contain persistent side effects"
},
"RULE-13-4": {
"properties": {
"obligation": "advisory"
},
"queries": [
{
"description": "The use of an assignment operator can impair the readability of the code and the introduced side effect may result in undefined behavior.",
"kind": "problem",
"name": "The result of an assignment operator should not be used",
"precision": "very-high",
"severity": "error",
"short_name": "ResultOfAnAssignmentOperatorShouldNotBeUsed",
"shared_implementation_short_name": "ResultOfAnAssignmentOperatorShouldNotBeUsed",
"tags": [
"correctness",
"readability",
"external/misra/c/2012/third-edition-first-revision"
]
}
],
"title": "The result of an assignment operator should not be used"
},
"RULE-13-5": {
"properties": {
"obligation": "required"
},
"queries": [
{
"description": "The evaluation of the right-hand operand of the && and || operators is conditional on the value of the left-hand operand. Any side effects in the right-hand operand may or may not occur and may result in unexpected program behavior.",
"kind": "problem",
"name": "The right hand operand of a logical && or || operator shall not contain persistent side effects",
"precision": "very-high",
"severity": "error",
"short_name": "PossibleSuppressedSideEffectInLogicOperatorOperand",
"tags": [
"correctness",
"external/misra/c/2012/third-edition-first-revision"
]
}
],
"title": "The right hand operand of a logical && or || operator shall not contain persistent side effects"
},
"RULE-13-6": {
"properties": {
"obligation": "required"
},
"queries": [
{
"description": "The operand to sizeof is not evaluated and its side effect will not be generated. Using an operand with a side effect can result in unexpected program behavior.",
"kind": "problem",
"name": "The operand of the sizeof operator shall not contain any expression which has potential side effects",
"precision": "very-high",
"severity": "error",
"short_name": "SizeofOperandWithSideEffect",
"tags": [
"correctness",
"external/misra/c/2012/third-edition-first-revision"
]
}
],
"title": "The operand of the sizeof operator shall not contain any expression which has potential side effects"
}
}
}