Skip to content

Commit 5f91c48

Browse files
committed
Prepare rule description files
1 parent d5b8a46 commit 5f91c48

File tree

3 files changed

+47
-5
lines changed

3 files changed

+47
-5
lines changed

rule_packages/c/Contracts7.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@
8282
"name": "An object shall not be assigned to an overlapping object",
8383
"precision": "high",
8484
"severity": "error",
85-
"short_name": "ObjectAssignedToAnOverlappingObject",
85+
"short_name": "ObjectAssignedToAnOverlappingObjectMisraC",
86+
"shared_implementation_short_name": "ObjectAssignedToAnOverlappingObject",
8687
"tags": [
8788
"correctness",
8889
"external/misra/c/2012/third-edition-first-revision"
@@ -94,7 +95,8 @@
9495
"name": "An object shall not be copied to an overlapping object",
9596
"precision": "high",
9697
"severity": "error",
97-
"short_name": "ObjectCopiedToAnOverlappingObject",
98+
"short_name": "ObjectCopiedToAnOverlappingObjectMisraC",
99+
"shared_implementation_short_name": "ObjectCopiedToAnOverlappingObject",
98100
"tags": [
99101
"correctness",
100102
"external/misra/c/2012/third-edition-first-revision"
@@ -104,4 +106,4 @@
104106
"title": "An object shall not be assigned or copied to an overlapping object"
105107
}
106108
}
107-
}
109+
}

rule_packages/cpp/Memory4.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"MISRA-C++-2023": {
3+
"RULE-8-18-1": {
4+
"properties": {
5+
"enforcement": "undecidable",
6+
"obligation": "mandatory"
7+
},
8+
"queries": [
9+
{
10+
"description": "Copying a member of a union to another causes undefined behavior.",
11+
"kind": "problem",
12+
"name": "A member of a union must not be copied to its another member",
13+
"precision": "high",
14+
"severity": "error",
15+
"short_name": "ObjectAssignedToAnOverlappingObjectMisraCpp",
16+
"shared_implementation_short_name": "ObjectAssignedToAnOverlappingObject",
17+
"tags": [
18+
"scope/system",
19+
"correctness"
20+
]
21+
},
22+
{
23+
"description": "Copying a slice of an array to an overlapping region of the same array causes undefined behavior.",
24+
"kind": "problem",
25+
"name": "An slice of an array must not be copied to an overlapping region of itself",
26+
"precision": "high",
27+
"severity": "error",
28+
"short_name": "ObjectCopiedToAnOverlappingObjectMisraCpp",
29+
"shared_implementation_short_name": "ObjectCopiedToAnOverlappingObject",
30+
"tags": [
31+
"scope/system",
32+
"correctness"
33+
]
34+
}
35+
],
36+
"title": "Copying a member of a union to another, and copying a slice of an array to an overlapping one causes undefined behavior."
37+
}
38+
}
39+
}

rule_packages/cpp/Representation.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
"name": "An object shall not be assigned to an overlapping object",
5050
"precision": "high",
5151
"severity": "error",
52-
"short_name": "ObjectAssignedToAnOverlappingObject",
52+
"short_name": "ObjectAssignedToAnOverlappingObjectAutosarCpp",
53+
"shared_implementation_short_name": "ObjectAssignedToAnOverlappingObject",
5354
"tags": [
5455
"correctness"
5556
]
@@ -176,4 +177,4 @@
176177
"title": "Do not access the bits of an object representation that are not part of the object's value representation"
177178
}
178179
}
179-
}
180+
}

0 commit comments

Comments
 (0)