Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions rule_packages/cpp/Memory1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"MISRA-C++-2023": {
"RULE-8-7-1": {
"properties": {
"enforcement": "undecidable",
"obligation": "required"
},
"queries": [
{
"description": "Pointers obtained as result of performing arithmetic should point to an initialized object, or an element right next to the last element of an array.",
"kind": "problem",
"name": "Pointer arithmetic shall not form an invalid pointer.",
"precision": "very-high",
"severity": "error",
"short_name": "PointerArithmeticFormsAnInvalidPointer",
"tags": [
"scope/system"
]
}
],
"title": "Pointers obtained as result of performing arithmetic should point to an initialized object, or an element right next to the last element of an array."
}
}
}
24 changes: 24 additions & 0 deletions rule_packages/cpp/Memory2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"MISRA-C++-2023": {
"RULE-8-7-2": {
"properties": {
"enforcement": "undecidable",
"obligation": "required"
},
"queries": [
{
"description": "Pointer difference should be taken from pointers that belong to a same array.",
"kind": "problem",
"name": "Subtraction between pointers shall only be applied to ones that address elements of the same array.",
"precision": "very-high",
"severity": "error",
"short_name": "PointerDifferenceTakenBetweenDifferentArrays",
"tags": [
"scope/system"
]
}
],
"title": "Pointer difference should be taken from pointers that belong to a same array."
}
}
}
24 changes: 24 additions & 0 deletions rule_packages/cpp/Memory3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"MISRA-C++-2023": {
"RULE-8-9-1": {
"properties": {
"enforcement": "undecidable",
"obligation": "required"
},
"queries": [
{
"description": "Pointer comparison should be done between ones that belong to a same array.",
"kind": "problem",
"name": "The built-in relational operators >, >=, < and <= shall not be applied to objects of pointer type.",
"precision": "very-high",
"severity": "error",
"short_name": "PointerComparedBetweenDifferentArrays",
"tags": [
"scope/system"
]
}
],
"title": "Pointer comparison should be done between ones that belong to a same array."
}
}
}
24 changes: 24 additions & 0 deletions rule_packages/cpp/Memory4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"MISRA-C++-2023": {
"RULE-8-18-1": {
"properties": {
"enforcement": "undecidable",
"obligation": "mandatory"
},
"queries": [
{
"description": "Copying a member of a union to another, and copying a slice of an array to an overlapping one causes undefined behavior.",
"kind": "problem",
"name": "An object or subobject must not be copied to an overlapping object.",
"precision": "high",
"severity": "error",
"short_name": "ObjectMustNotBeCopiedToAnOverlappingObject",
"tags": [
"scope/system"
]
}
],
"title": "Copying a member of a union to another, and copying a slice of an array to an overlapping one causes undefined behavior."
}
}
}
24 changes: 24 additions & 0 deletions rule_packages/cpp/Memory5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"MISRA-C++-2023": {
"RULE-21-6-2": {
"properties": {
"enforcement": "decidable",
"obligation": "required"
},
"queries": [
{
"description": "Dynamically allocated memory must not be managed manually.",
"kind": "problem",
"name": "Dynamic memory shall be managed automatically.",
"precision": "very-high",
"severity": "error",
"short_name": "DynamicMemoryManagedManually",
"tags": [
"scope/single-translation-unit"
]
}
],
"title": "Dynamically allocated memory must not be managed manually."
}
}
}
24 changes: 24 additions & 0 deletions rule_packages/cpp/Memory6.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"MISRA-C++-2023": {
"RULE-21-6-3": {
"properties": {
"enforcement": "decidable",
"obligation": "required"
},
"queries": [
{
"description": "Using advanced memory management that either alters allocation and deallocation or constructs object construction on uninitalized memory may result in undefined behavior.",
"kind": "problem",
"name": "Advanced memory management shall not be used.",
"precision": "very-high",
"severity": "error",
"short_name": "AdvancedMemoryManagementUsed",
"tags": [
"scope/single-translation-unit"
]
}
],
"title": "Using advanced memory management that either alters allocation and deallocation or constructs object construction on uninitalized memory may result in undefined behavior."
}
}
}
12 changes: 6 additions & 6 deletions rules.csv
Original file line number Diff line number Diff line change
Expand Up @@ -895,11 +895,11 @@ cpp,MISRA-C++-2023,RULE-8-2-10,Yes,Required,Undecidable,System,"Functions shall
cpp,MISRA-C++-2023,RULE-8-2-11,Yes,Required,Decidable,Single Translation Unit,An argument passed via ellipsis shall have an appropriate type,,Preconditions,Easy,
cpp,MISRA-C++-2023,RULE-8-3-1,Yes,Advisory,Decidable,Single Translation Unit,The built-in unary - operator should not be applied to an expression of unsigned type,M5-3-2,ImportMisra23,Import,
cpp,MISRA-C++-2023,RULE-8-3-2,Yes,Advisory,Decidable,Single Translation Unit,The built-in unary + operator should not be used,,Banned,Easy,
cpp,MISRA-C++-2023,RULE-8-7-1,Yes,Required,Undecidable,System,Pointer arithmetic shall not form an invalid pointer,ARR30-C,Memory,Easy,
cpp,MISRA-C++-2023,RULE-8-7-2,Yes,Required,Undecidable,System,Subtraction between pointers shall only be applied to pointers that address elements of the same array,ARR36-C,Memory,Easy,
cpp,MISRA-C++-2023,RULE-8-9-1,Yes,Required,Undecidable,System,"The built-in relational operators >, >=, < and <= shall not be applied to objects of pointer type, except where they point to elements of the same array",ARR36-C,Memory,Easy,
cpp,MISRA-C++-2023,RULE-8-7-1,Yes,Required,Undecidable,System,Pointer arithmetic shall not form an invalid pointer,ARR30-C,Memory1,Easy,
cpp,MISRA-C++-2023,RULE-8-7-2,Yes,Required,Undecidable,System,Subtraction between pointers shall only be applied to pointers that address elements of the same array,ARR36-C,Memory2,Easy,
cpp,MISRA-C++-2023,RULE-8-9-1,Yes,Required,Undecidable,System,"The built-in relational operators >, >=, < and <= shall not be applied to objects of pointer type, except where they point to elements of the same array",ARR36-C,Memory3,Easy,
cpp,MISRA-C++-2023,RULE-8-14-1,Yes,Advisory,Undecidable,System,The right-hand operand of a logical && or operator should not contain persistent side effects,"M5-14-1, RULE-13-5",SideEffects3,Medium,
cpp,MISRA-C++-2023,RULE-8-18-1,Yes,Mandatory,Undecidable,System,An object or subobject must not be copied to an overlapping object,"M0-2-1, RULE-19-1",Memory,Hard,
cpp,MISRA-C++-2023,RULE-8-18-1,Yes,Mandatory,Undecidable,System,An object or subobject must not be copied to an overlapping object,"M0-2-1, RULE-19-1",Memory4,Hard,
cpp,MISRA-C++-2023,RULE-8-18-2,Yes,Advisory,Decidable,Single Translation Unit,The result of an assignment operator should not be used,RULE-13-4,ImportMisra23,Import,
cpp,MISRA-C++-2023,RULE-8-19-1,Yes,Advisory,Decidable,Single Translation Unit,The comma operator should not be used,M5-18-1,ImportMisra23,Import,
cpp,MISRA-C++-2023,RULE-8-20-1,Yes,Advisory,Decidable,Single Translation Unit,An unsigned arithmetic operation with constant operands should not wrap,INT30-C,ImportMisra23,Import,
Expand Down Expand Up @@ -979,8 +979,8 @@ cpp,MISRA-C++-2023,RULE-21-2-2,Yes,Required,Decidable,Single Translation Unit,"T
cpp,MISRA-C++-2023,RULE-21-2-3,Yes,Required,Decidable,Single Translation Unit,The library function system from <cstdlib> shall not be used,M18-0-3,BannedAPIs,Easy,
cpp,MISRA-C++-2023,RULE-21-2-4,Yes,Required,Decidable,Single Translation Unit,The macro offsetof shall not be used,M18-2-1,ImportMisra23,Import,
cpp,MISRA-C++-2023,RULE-21-6-1,Yes,Advisory,Undecidable,Single Translation Unit,Dynamic memory should not be used,DIR-4-12,Banned,Easy,
cpp,MISRA-C++-2023,RULE-21-6-2,Yes,Required,Decidable,Single Translation Unit,Dynamic memory shall be managed automatically,,Memory,Easy,
cpp,MISRA-C++-2023,RULE-21-6-3,Yes,Required,Decidable,Single Translation Unit,Advanced memory management shall not be used,,Memory,Medium,
cpp,MISRA-C++-2023,RULE-21-6-2,Yes,Required,Decidable,Single Translation Unit,Dynamic memory shall be managed automatically,,Memory5,Easy,
cpp,MISRA-C++-2023,RULE-21-6-3,Yes,Required,Decidable,Single Translation Unit,Advanced memory management shall not be used,,Memory6,Medium,
cpp,MISRA-C++-2023,RULE-21-6-4,Yes,Required,Decidable,System,"If a project defines either a sized or unsized version of a global operator delete, then both shall be defined",A18-5-4,ImportMisra23,Import,
cpp,MISRA-C++-2023,RULE-21-6-5,Yes,Required,Decidable,Single Translation Unit,A pointer to an incomplete class type shall not be deleted,A5-3-3,ImportMisra23,Import,
cpp,MISRA-C++-2023,RULE-21-10-1,Yes,Required,Decidable,Single Translation Unit,The features of <cstdarg> shall not be used,DCL50-CPP,BannedAPIs,Easy,
Expand Down
Loading