From 0deee2c074da7728e80cf21400eba1e6cc689b4c Mon Sep 17 00:00:00 2001 From: Luke Cartey <5377966+lcartey@users.noreply.github.com> Date: Tue, 7 May 2024 10:42:14 +0000 Subject: [PATCH 1/7] Support MISRA C++ 2023 in generation scripts --- .../generate_rules/generate_package_description.py | 14 ++++++++++++-- scripts/generate_rules/generate_package_files.py | 6 +++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/scripts/generate_rules/generate_package_description.py b/scripts/generate_rules/generate_package_description.py index 20c9adc065..bf993af574 100644 --- a/scripts/generate_rules/generate_package_description.py +++ b/scripts/generate_rules/generate_package_description.py @@ -110,6 +110,8 @@ def generate_short_name(title): print("Error: " + standard + " " + rule_id + " is marked as part of package " + package_name + " but is not marked as supportable.") sys.exit(1) + tags = [] + # Add the AUTOSAR obligation, enforcement and allocated target as query properties. properties = {} if obligation_level: @@ -117,7 +119,15 @@ def generate_short_name(title): if enforcement_level: properties["enforcement"] = enforcement_level.lower() if allocated_targets: - properties["allocated-target"] = [target.strip(' ').lower() for target in allocated_targets.split("/")] + if allocated_targets == "Single Translation Unit": + # MISRA C++ 2023 uses the allocated targets field for scope + tags.append("scope/single-translation-unit") + elif allocated_targets == "System": + # MISRA C++ 2023 uses the allocated targets field for scope + tags.append("scope/system") + else: + properties["allocated-target"] = [target.strip(' ').lower() for target in allocated_targets.split("/")] + if difficulty == "Audit": properties["audit"] = "" @@ -164,7 +174,7 @@ def generate_short_name(title): "severity" : severity, "description" : description, "kind" : "problem", - "tags" : [] + "tags" : tags } ] } diff --git a/scripts/generate_rules/generate_package_files.py b/scripts/generate_rules/generate_package_files.py index 6dabec0a92..ed8bb625bd 100644 --- a/scripts/generate_rules/generate_package_files.py +++ b/scripts/generate_rules/generate_package_files.py @@ -58,11 +58,15 @@ "MISRA-C-2012" : { "standard_title" : "MISRA-C:2012 Guidelines for the use of the C language in critical systems", "standard_url" : "https://www.misra.org.uk/" + }, + "MISRA-C++-2023" : { + "standard_title" : "MISRA C++:2023 Guidelines for the use C++:17 in critical systems", + "standard_url" : "https://misra.org.uk/product/misra-cpp2023/" } } # The help files of these standards cannot be distributed in our repository. -external_help_file_standards = ["AUTOSAR", "MISRA-C-2012"] +external_help_file_standards = ["AUTOSAR", "MISRA-C-2012", "MISRA-C++-2023"] # Mapping from the QL language to source file extension used to generate a help example file. ql_language_ext_mappings = { From 86bf6aa5e4ae128ec883ec54d25045410c39aa19 Mon Sep 17 00:00:00 2001 From: Luke Cartey <5377966+lcartey@users.noreply.github.com> Date: Tue, 7 May 2024 10:42:51 +0000 Subject: [PATCH 2/7] Update MISRA C++ pack to 2023. --- cpp/misra/src/codeql-suites/misra-default.qls | 10 ++++++++++ .../codeql-suites/misra-single-translation-unit.qls | 12 ++++++++++++ cpp/misra/src/misra.qll | 4 ++++ cpp/misra/src/misra/Customizations.qll | 8 ++++++++ cpp/misra/src/qlpack.yml | 2 +- cpp/misra/test/options | 1 + 6 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 cpp/misra/src/codeql-suites/misra-default.qls create mode 100644 cpp/misra/src/codeql-suites/misra-single-translation-unit.qls create mode 100644 cpp/misra/src/misra.qll create mode 100644 cpp/misra/src/misra/Customizations.qll create mode 100644 cpp/misra/test/options diff --git a/cpp/misra/src/codeql-suites/misra-default.qls b/cpp/misra/src/codeql-suites/misra-default.qls new file mode 100644 index 0000000000..670b043caa --- /dev/null +++ b/cpp/misra/src/codeql-suites/misra-default.qls @@ -0,0 +1,10 @@ +- description: MISRA C++ 2023 (Default) +- qlpack: codeql/misra-cpp-coding-standards +- include: + kind: + - problem + - path-problem +- exclude: + tags contain: + - external/misra/audit + - external/misra/default-disabled diff --git a/cpp/misra/src/codeql-suites/misra-single-translation-unit.qls b/cpp/misra/src/codeql-suites/misra-single-translation-unit.qls new file mode 100644 index 0000000000..0782dd876d --- /dev/null +++ b/cpp/misra/src/codeql-suites/misra-single-translation-unit.qls @@ -0,0 +1,12 @@ +- description: MISRA C++ 2023 (Single Translation Unit) +- qlpack: codeql/misra-cpp-coding-standards +- include: + kind: + - problem + - path-problem + tags contain: + - scope/single-translation-unit +- exclude: + tags contain: + - external/misra/audit + - external/misra/default-disabled diff --git a/cpp/misra/src/misra.qll b/cpp/misra/src/misra.qll new file mode 100644 index 0000000000..e48b094ebc --- /dev/null +++ b/cpp/misra/src/misra.qll @@ -0,0 +1,4 @@ +import cpp +import misra.Customizations +import codingstandards.cpp.CodingStandards +import codingstandards.cpp.exclusions.cpp.RuleMetadata \ No newline at end of file diff --git a/cpp/misra/src/misra/Customizations.qll b/cpp/misra/src/misra/Customizations.qll new file mode 100644 index 0000000000..b95d1bb3b3 --- /dev/null +++ b/cpp/misra/src/misra/Customizations.qll @@ -0,0 +1,8 @@ +/** + * Contains customizations to the MISRA C++ query rules. + * + * This module is imported by `misra.qll`, so any customizations defined here + * automatically apply to all MISRA C++ queries. + */ + +import cpp diff --git a/cpp/misra/src/qlpack.yml b/cpp/misra/src/qlpack.yml index e2e6e58b0a..382dc41122 100644 --- a/cpp/misra/src/qlpack.yml +++ b/cpp/misra/src/qlpack.yml @@ -1,6 +1,6 @@ name: codeql/misra-cpp-coding-standards version: 2.28.0-dev -description: MISRA C++ 2008 +description: MISRA C++ 2023 suites: codeql-suites license: MIT dependencies: diff --git a/cpp/misra/test/options b/cpp/misra/test/options new file mode 100644 index 0000000000..59fc70d386 --- /dev/null +++ b/cpp/misra/test/options @@ -0,0 +1 @@ +semmle-extractor-options:--clang -std=c++17 -nostdinc++ -I../../../../common/test/includes/standard-library -I../../../../common/test/includes/custom-library \ No newline at end of file From e4e30c4fed8449e578c8e63c8d0f1700967ff633 Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Fri, 10 May 2024 18:25:12 +0200 Subject: [PATCH 3/7] MISRA C++ 2023 pack structure --- cpp/common/test/options | 1 + .../src/{ => codingstandards/cpp}/misra.qll | 0 .../cpp}/misra/Customizations.qll | 0 docs/design/guideline_recategorization.md | 2 +- rules.csv | 2 +- schemas/rule-package.schema.json | 49 +++++++++++++++++++ scripts/reports/utils.py | 2 +- 7 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 cpp/common/test/options rename cpp/misra/src/{ => codingstandards/cpp}/misra.qll (100%) rename cpp/misra/src/{ => codingstandards/cpp}/misra/Customizations.qll (100%) diff --git a/cpp/common/test/options b/cpp/common/test/options new file mode 100644 index 0000000000..59fc70d386 --- /dev/null +++ b/cpp/common/test/options @@ -0,0 +1 @@ +semmle-extractor-options:--clang -std=c++17 -nostdinc++ -I../../../../common/test/includes/standard-library -I../../../../common/test/includes/custom-library \ No newline at end of file diff --git a/cpp/misra/src/misra.qll b/cpp/misra/src/codingstandards/cpp/misra.qll similarity index 100% rename from cpp/misra/src/misra.qll rename to cpp/misra/src/codingstandards/cpp/misra.qll diff --git a/cpp/misra/src/misra/Customizations.qll b/cpp/misra/src/codingstandards/cpp/misra/Customizations.qll similarity index 100% rename from cpp/misra/src/misra/Customizations.qll rename to cpp/misra/src/codingstandards/cpp/misra/Customizations.qll diff --git a/docs/design/guideline_recategorization.md b/docs/design/guideline_recategorization.md index f520869f39..e488cf88de 100644 --- a/docs/design/guideline_recategorization.md +++ b/docs/design/guideline_recategorization.md @@ -101,7 +101,7 @@ The *effective category* is the category whose policy is applied during the eval The policy of a category dictates if a result can be deviated from and implements the effect described in the design section. The existing exclusion mechanism implemented in the predicate `isExcluded` defined in the `Exclusions.qll` library will be updated to consider the applicable policy of a guideline. -Note: This changes the behavior of deviations which will no longer have an impact on Mandatory guidelines! However, this will only affect MISRA C rules because there are no MISRA C++ Guidelines with a Mandatory category. +Note: This changes the behavior of deviations which will no longer have an impact on Mandatory MISRA guidelines! ### Specification validation diff --git a/rules.csv b/rules.csv index 913aa27282..2fcf32c915 100644 --- a/rules.csv +++ b/rules.csv @@ -774,7 +774,7 @@ c,MISRA-C-2012,RULE-22-7,Yes,Required,,,The macro EOF shall only be compared wit c,MISRA-C-2012,RULE-22-8,Yes,Required,,,The value of errno shall be set to zero prior to a call to an errno-setting-function,ERR30-C,Contracts3,Medium, c,MISRA-C-2012,RULE-22-9,Yes,Required,,,The value of errno shall be tested against zero after calling an errno-setting-function,,Contracts3,Medium, c,MISRA-C-2012,RULE-22-10,Yes,Required,,,The value of errno shall only be tested when the last function to be called was an errno-setting-function,,Contracts3,Medium, -cpp,MISRA-C++-2023,RULE-0-0-1,Yes,Required,Decidable,Single Translation Unit,A function shall not contain unreachable statements,,,Medium, +cpp,MISRA-C++-2023,RULE-0-0-1,Yes,Required,Decidable,Single Translation Unit,A function shall not contain unreachable statements,,DeadCode,Medium, cpp,MISRA-C++-2023,RULE-0-0-2,Yes,Advisory,Undecidable,System,Controlling expressions should not be invariant,,,Easy, cpp,MISRA-C++-2023,RULE-0-1-1,Yes,Advisory,Undecidable,System,A value should not be unnecessarily written to a local object,,,Medium, cpp,MISRA-C++-2023,RULE-0-1-2,Yes,Required,Decidable,Single Translation Unit,The value returned by a function shall be used,,,Easy, diff --git a/schemas/rule-package.schema.json b/schemas/rule-package.schema.json index 4d3c7f401a..daeb1ade51 100644 --- a/schemas/rule-package.schema.json +++ b/schemas/rule-package.schema.json @@ -220,6 +220,55 @@ "minProperties": 1 } } + }, + { + "properties": { + "MISRA-C++-2023": { + "description": "Rules part of the MISRA C++ 2023 standard", + "type": "object", + "patternProperties": { + "^RULE-\\d+-\\d+-\\d+": { + "description": "A coding standard rule", + "type": "object", + "properties": { + "properties": { + "type": "object", + "properties": { + "obligation": { + "type": "string", + "enum": [ + "required", + "advisory", + "mandatory" + ] + } + }, + "required": [ + "obligation" + ] + }, + "queries": { + "type": "array", + "uniqueItems": true, + "items": { + "$ref": "#/$defs/query" + } + }, + "title": { + "type": "string" + } + }, + "required": [ + "properties", + "queries", + "title" + ], + "additionalProperties": false + } + }, + "minProperties": 1 + } + } } ], "minProperties": 1, diff --git a/scripts/reports/utils.py b/scripts/reports/utils.py index 977826891c..6f5785808e 100644 --- a/scripts/reports/utils.py +++ b/scripts/reports/utils.py @@ -149,7 +149,7 @@ def __init__(self, sarif_results_file_path): if standard_rule_id in self.guideline_obligation_level[standard_short_name]: if not self.guideline_obligation_level[standard_short_name][standard_rule_id] == obligation_level: print( - f"WARNING: Rule { rule['id'] } specifies a conflicting obligation level of { obligation_level }, was previously specified as { guideline_obligation_level[standard_short_name][standard_rule_id] }.") + f"WARNING: Rule { rule['id'] } specifies a conflicting obligation level of { obligation_level }, was previously specified as { self.guideline_obligation_level[standard_short_name][standard_rule_id] }.") else: self.guideline_obligation_level[standard_short_name][standard_rule_id] = obligation_level # Add deviation counts for the rule From 854682e4d80972983a23ea0a89d573edc7780adc Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Fri, 10 May 2024 18:40:39 +0200 Subject: [PATCH 4/7] Fix format --- cpp/misra/src/codingstandards/cpp/misra.qll | 2 +- rules.csv | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/misra/src/codingstandards/cpp/misra.qll b/cpp/misra/src/codingstandards/cpp/misra.qll index e48b094ebc..ff308d4fd2 100644 --- a/cpp/misra/src/codingstandards/cpp/misra.qll +++ b/cpp/misra/src/codingstandards/cpp/misra.qll @@ -1,4 +1,4 @@ import cpp import misra.Customizations import codingstandards.cpp.CodingStandards -import codingstandards.cpp.exclusions.cpp.RuleMetadata \ No newline at end of file +import codingstandards.cpp.exclusions.cpp.RuleMetadata diff --git a/rules.csv b/rules.csv index 2fcf32c915..913aa27282 100644 --- a/rules.csv +++ b/rules.csv @@ -774,7 +774,7 @@ c,MISRA-C-2012,RULE-22-7,Yes,Required,,,The macro EOF shall only be compared wit c,MISRA-C-2012,RULE-22-8,Yes,Required,,,The value of errno shall be set to zero prior to a call to an errno-setting-function,ERR30-C,Contracts3,Medium, c,MISRA-C-2012,RULE-22-9,Yes,Required,,,The value of errno shall be tested against zero after calling an errno-setting-function,,Contracts3,Medium, c,MISRA-C-2012,RULE-22-10,Yes,Required,,,The value of errno shall only be tested when the last function to be called was an errno-setting-function,,Contracts3,Medium, -cpp,MISRA-C++-2023,RULE-0-0-1,Yes,Required,Decidable,Single Translation Unit,A function shall not contain unreachable statements,,DeadCode,Medium, +cpp,MISRA-C++-2023,RULE-0-0-1,Yes,Required,Decidable,Single Translation Unit,A function shall not contain unreachable statements,,,Medium, cpp,MISRA-C++-2023,RULE-0-0-2,Yes,Advisory,Undecidable,System,Controlling expressions should not be invariant,,,Easy, cpp,MISRA-C++-2023,RULE-0-1-1,Yes,Advisory,Undecidable,System,A value should not be unnecessarily written to a local object,,,Medium, cpp,MISRA-C++-2023,RULE-0-1-2,Yes,Required,Decidable,Single Translation Unit,The value returned by a function shall be used,,,Easy, From 0b965ffb4c6e6c5ca2b8f1972a7f194bef8ba058 Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Thu, 16 May 2024 17:11:50 +0200 Subject: [PATCH 5/7] Rules with preexisting import --- .../cpp/exclusions/cpp/ImportMisra23.qll | 1319 +++++++++++++++++ .../cpp/exclusions/cpp/RuleMetadata.qll | 3 + .../SectionsOfCodeShouldNotBeCommentedOut.ql | 23 + .../DeclarationOfAnObjectIndirectionsLevel.ql | 24 + ...rsReferToNonStaticMembersFromTheirClass.ql | 24 + ...ectivesPrecededByPreprocessorDirectives.ql | 23 + ...tifiersUsedInTheControllingExpressionOf.ql | 25 + ...CharsThatShouldNotOccurInHeaderFileName.ql | 24 + ...AndPreprocessorOperatorsShouldNotBeUsed.ql | 23 + ...sThatLookLikeDirectivesInAMacroArgument.ql | 24 + .../PointerToAnIncompleteClassTypeDeleted.ql | 23 + ...urnedByLocaleFunctionsMustBeUsedAsConst.ql | 26 + ...lToSetlocaleInvalidatesOldPointersMisra.ql | 25 + ...etlocaleInvalidatesOldPointersWarnMisra.ql | 25 + ...ectUsedWhileInPotentiallyMovedFromState.ql | 23 + ...WritesOnStreamNotSeparatedByPositioning.ql | 23 + .../RULE-6-2-1/OneDefinitionRuleViolated.ql | 23 + ...ableDeclaredInInnerScopeHidesOuterScope.ql | 24 + .../ObjectAccessedAfterLifetimeMisra.ql | 23 + .../ObjectAccessedBeforeLifetimeMisra.ql | 23 + ...esConstOrVolatileFromPointerOrReference.ql | 24 + .../rules/RULE-9-4-1/IfElseIfEndCondition.ql | 24 + ...llJumpToLabelDeclaredLaterInTheFunction.ql | 24 + ...nDeclaredWithTheNoreturnAttributeReturn.ql | 23 + ...VoidFunctionShallReturnAValueOnAllPaths.ql | 23 + ...tionsOfCodeShouldNotBeCommentedOut.testref | 1 + ...arationOfAnObjectIndirectionsLevel.testref | 1 + ...erToNonStaticMembersFromTheirClass.testref | 1 + ...esPrecededByPreprocessorDirectives.testref | 1 + ...rsUsedInTheControllingExpressionOf.testref | 1 + ...ThatShouldNotOccurInHeaderFileName.testref | 1 + ...eprocessorOperatorsShouldNotBeUsed.testref | 1 + ...LookLikeDirectivesInAMacroArgument.testref | 1 + ...nterToAnIncompleteClassTypeDeleted.testref | 1 + ...ByLocaleFunctionsMustBeUsedAsConst.testref | 1 + ...tlocaleInvalidatesOldPointersMisra.testref | 1 + ...aleInvalidatesOldPointersWarnMisra.testref | 1 + ...edWhileInPotentiallyMovedFromState.testref | 1 + ...sOnStreamNotSeparatedByPositioning.testref | 1 + .../OneDefinitionRuleViolated.testref | 1 + ...eclaredInInnerScopeHidesOuterScope.testref | 1 + .../ObjectAccessedAfterLifetimeMisra.testref | 1 + .../ObjectAccessedBeforeLifetimeMisra.testref | 1 + ...stOrVolatileFromPointerOrReference.testref | 1 + .../RULE-9-4-1/IfElseIfEndCondition.testref | 1 + ...pToLabelDeclaredLaterInTheFunction.testref | 1 + ...aredWithTheNoreturnAttributeReturn.testref | 1 + ...unctionShallReturnAValueOnAllPaths.testref | 1 + rule_packages/cpp/ImportMisra23.json | 505 +++++++ rules.csv | 264 ++-- 50 files changed, 2528 insertions(+), 132 deletions(-) create mode 100644 cpp/common/src/codingstandards/cpp/exclusions/cpp/ImportMisra23.qll create mode 100644 cpp/misra/src/rules/DIR-5-7-2/SectionsOfCodeShouldNotBeCommentedOut.ql create mode 100644 cpp/misra/src/rules/RULE-11-3-2/DeclarationOfAnObjectIndirectionsLevel.ql create mode 100644 cpp/misra/src/rules/RULE-18-3-3/HandlersReferToNonStaticMembersFromTheirClass.ql create mode 100644 cpp/misra/src/rules/RULE-19-0-3/IncludeDirectivesPrecededByPreprocessorDirectives.ql create mode 100644 cpp/misra/src/rules/RULE-19-1-3/IdentifiersUsedInTheControllingExpressionOf.ql create mode 100644 cpp/misra/src/rules/RULE-19-2-3/CharsThatShouldNotOccurInHeaderFileName.ql create mode 100644 cpp/misra/src/rules/RULE-19-3-1/AndPreprocessorOperatorsShouldNotBeUsed.ql create mode 100644 cpp/misra/src/rules/RULE-19-3-5/TokensThatLookLikeDirectivesInAMacroArgument.ql create mode 100644 cpp/misra/src/rules/RULE-21-6-5/PointerToAnIncompleteClassTypeDeleted.ql create mode 100644 cpp/misra/src/rules/RULE-25-5-2/PointersReturnedByLocaleFunctionsMustBeUsedAsConst.ql create mode 100644 cpp/misra/src/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersMisra.ql create mode 100644 cpp/misra/src/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersWarnMisra.ql create mode 100644 cpp/misra/src/rules/RULE-28-6-3/ObjectUsedWhileInPotentiallyMovedFromState.ql create mode 100644 cpp/misra/src/rules/RULE-30-0-2/ReadsAndWritesOnStreamNotSeparatedByPositioning.ql create mode 100644 cpp/misra/src/rules/RULE-6-2-1/OneDefinitionRuleViolated.ql create mode 100644 cpp/misra/src/rules/RULE-6-4-1/VariableDeclaredInInnerScopeHidesOuterScope.ql create mode 100644 cpp/misra/src/rules/RULE-6-8-1/ObjectAccessedAfterLifetimeMisra.ql create mode 100644 cpp/misra/src/rules/RULE-6-8-1/ObjectAccessedBeforeLifetimeMisra.ql create mode 100644 cpp/misra/src/rules/RULE-8-2-3/CastRemovesConstOrVolatileFromPointerOrReference.ql create mode 100644 cpp/misra/src/rules/RULE-9-4-1/IfElseIfEndCondition.ql create mode 100644 cpp/misra/src/rules/RULE-9-6-3/GotoShallJumpToLabelDeclaredLaterInTheFunction.ql create mode 100644 cpp/misra/src/rules/RULE-9-6-4/FunctionDeclaredWithTheNoreturnAttributeReturn.ql create mode 100644 cpp/misra/src/rules/RULE-9-6-5/NonVoidFunctionShallReturnAValueOnAllPaths.ql create mode 100644 cpp/misra/test/rules/DIR-5-7-2/SectionsOfCodeShouldNotBeCommentedOut.testref create mode 100644 cpp/misra/test/rules/RULE-11-3-2/DeclarationOfAnObjectIndirectionsLevel.testref create mode 100644 cpp/misra/test/rules/RULE-18-3-3/HandlersReferToNonStaticMembersFromTheirClass.testref create mode 100644 cpp/misra/test/rules/RULE-19-0-3/IncludeDirectivesPrecededByPreprocessorDirectives.testref create mode 100644 cpp/misra/test/rules/RULE-19-1-3/IdentifiersUsedInTheControllingExpressionOf.testref create mode 100644 cpp/misra/test/rules/RULE-19-2-3/CharsThatShouldNotOccurInHeaderFileName.testref create mode 100644 cpp/misra/test/rules/RULE-19-3-1/AndPreprocessorOperatorsShouldNotBeUsed.testref create mode 100644 cpp/misra/test/rules/RULE-19-3-5/TokensThatLookLikeDirectivesInAMacroArgument.testref create mode 100644 cpp/misra/test/rules/RULE-21-6-5/PointerToAnIncompleteClassTypeDeleted.testref create mode 100644 cpp/misra/test/rules/RULE-25-5-2/PointersReturnedByLocaleFunctionsMustBeUsedAsConst.testref create mode 100644 cpp/misra/test/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersMisra.testref create mode 100644 cpp/misra/test/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersWarnMisra.testref create mode 100644 cpp/misra/test/rules/RULE-28-6-3/ObjectUsedWhileInPotentiallyMovedFromState.testref create mode 100644 cpp/misra/test/rules/RULE-30-0-2/ReadsAndWritesOnStreamNotSeparatedByPositioning.testref create mode 100644 cpp/misra/test/rules/RULE-6-2-1/OneDefinitionRuleViolated.testref create mode 100644 cpp/misra/test/rules/RULE-6-4-1/VariableDeclaredInInnerScopeHidesOuterScope.testref create mode 100644 cpp/misra/test/rules/RULE-6-8-1/ObjectAccessedAfterLifetimeMisra.testref create mode 100644 cpp/misra/test/rules/RULE-6-8-1/ObjectAccessedBeforeLifetimeMisra.testref create mode 100644 cpp/misra/test/rules/RULE-8-2-3/CastRemovesConstOrVolatileFromPointerOrReference.testref create mode 100644 cpp/misra/test/rules/RULE-9-4-1/IfElseIfEndCondition.testref create mode 100644 cpp/misra/test/rules/RULE-9-6-3/GotoShallJumpToLabelDeclaredLaterInTheFunction.testref create mode 100644 cpp/misra/test/rules/RULE-9-6-4/FunctionDeclaredWithTheNoreturnAttributeReturn.testref create mode 100644 cpp/misra/test/rules/RULE-9-6-5/NonVoidFunctionShallReturnAValueOnAllPaths.testref create mode 100644 rule_packages/cpp/ImportMisra23.json diff --git a/cpp/common/src/codingstandards/cpp/exclusions/cpp/ImportMisra23.qll b/cpp/common/src/codingstandards/cpp/exclusions/cpp/ImportMisra23.qll new file mode 100644 index 0000000000..b8fef48f1f --- /dev/null +++ b/cpp/common/src/codingstandards/cpp/exclusions/cpp/ImportMisra23.qll @@ -0,0 +1,1319 @@ +//** THIS FILE IS AUTOGENERATED, DO NOT MODIFY DIRECTLY. **/ +import cpp +import RuleMetadata +import codingstandards.cpp.exclusions.RuleMetadata + +newtype ImportMisra23Query = + TUserCopyAndMoveAssignmentShallHandleSelfAssignmentQuery() or + TSectionsOfCodeShouldNotBeCommentedOutQuery() or + TDeclarationShouldNotDeclareMoreThanOneVariableQuery() or + TEnumerationNotDefinedWithAnExplicitUnderlyingTypeQuery() or + TAsmDeclarationShallNotBeUsedQuery() or + TDeclarationOfAnObjectIndirectionsLevelQuery() or + TValueOfAnEnumerationConstantNotUniqueQuery() or + TBitFieldShallHaveAnAppropriateTypeQuery() or + TSignedIntegerBitFieldHaveALengthOfOneBitQuery() or + TVirtualAndNonVirtualBaseClassInHierarchyQuery() or + TDifferentDefaultArgsInOverridingVirtualFunctionQuery() or + TDeclarationsOrOverridesParamsAreUnnamedOrIdenticalQuery() or + TComparisonOfVirtualPointerOnlyBeWithNullptrQuery() or + TDynamicTypeUsedWithinConstructorOrDestructorQuery() or + TConstructorsShouldInitializeAllBaseClassesQuery() or + TInitializerListConstructorIsTheOnlyConstructorQuery() or + TAddressOfOperatorOverloadedQuery() or + TFunctionTemplatesExplicitlySpecializedQuery() or + TExceptionObjectHavePointerTypeQuery() or + TEmptyThrowShallOnlyOccurWithinACatchHandlerQuery() or + THandlersReferToNonStaticMembersFromTheirClassQuery() or + TNoexceptFunctionShouldNotPropagateAnExceptionQuery() or + TFunctionLikeMacrosDefinedQuery() or + TIncludeDirectivesPrecededByPreprocessorDirectivesQuery() or + TIdentifiersUsedInTheControllingExpressionOfQuery() or + TCharsThatShouldNotOccurInHeaderFileNameQuery() or + TAndPreprocessorOperatorsShouldNotBeUsedQuery() or + TMacroParameterFollowingAHashOperatorQuery() or + TArgumentToAMixedUseMacroShoulNotNeedExpansionQuery() or + TTokensThatLookLikeDirectivesInAMacroArgumentQuery() or + TFacilitiesProvidedByCsignalUsedQuery() or + TAtofAtoiAtolAndAtollFromCstdlibUsedQuery() or + TMacroOffsetShouldNotBeUsedQuery() or + TDefineBothSizedAndUnsizedVersionOfAGlobalOperatorQuery() or + TPointerToAnIncompleteClassTypeDeletedQuery() or + TPointersReturnedByLocaleFunctionsMustBeUsedAsConstQuery() or + TCallToSetlocaleInvalidatesOldPointersMisraQuery() or + TCallToSetlocaleInvalidatesOldPointersWarnMisraQuery() or + TVectorShouldNotBeSpecializedWithBoolQuery() or + TForwardingReferencesAndForwardNotUsedTogetherQuery() or + TObjectUsedWhileInPotentiallyMovedFromStateQuery() or + TCLibraryInputoutputFunctionsUsedQuery() or + TReadsAndWritesOnStreamNotSeparatedByPositioningQuery() or + TOperationsOnMemoryNotSequencedAppropriatelyQuery() or + TCharacterOnlyInEscapeSequenceOrUniversalCharNameQuery() or + TEscapeSequencesAndUniversalCharNamesNotTerminatedQuery() or + TOctalConstantsUsedQuery() or + TUnsignedIntegerLiteralsNotAppropriatelySuffixedQuery() or + TLowercaseLUsedAsFirstCharacterInLiteralSuffixQuery() or + TCharacterSequenceUsedWithinACStyleCommentQuery() or + TLineSplicingUsedInCommentsQuery() or + TGlobalDeclarationsOnlyMainNamespaceOrExternCQuery() or + TMainUsedOnlyForTheGlobalFunctionMainQuery() or + TOneDefinitionRuleViolatedQuery() or + TVariableDeclaredInInnerScopeHidesOuterScopeQuery() or + TDerivedClasseConcealFunctionInheritedFromTheBaseQuery() or + TNameInDependentBaseResolvedByUnqualifiedLookupQuery() or + TObjectAccessedBeforeLifetimeMisraQuery() or + TObjectAccessedAfterLifetimeMisraQuery() or + TMustNotReturnReferenceToLocalAutomaticVariableQuery() or + TNullptrNotTheOnlyFormOfTheNullPointerConstantQuery() or + TArrayPassedAsFunctionArgumentDecayToAPointerQuery() or + TResultOfAnAssignmentOperatorShouldNotBeUsedQuery() or + TCommaOperatorShouldNotBeUsedQuery() or + TFunctionsCallThemselvesEitherDirectlyOrIndirectlyQuery() or + TCastRemovesConstOrVolatileFromPointerOrReferenceQuery() or + TCastsBetweenAPointerToFunctionAndAnyOtherTypeQuery() or + TReinterpretCastShallNotBeUsedQuery() or + TUnsignedOperationWithConstantOperandsShouldNotWrapQuery() or + TBuiltInOperatorAppliedToUnsignedExpressionQuery() or + TBodyOfIterationOrSelectionStatementNotCompoundQuery() or + TIfElseIfEndConditionQuery() or + TGotoStatementShouldNotBeUsedQuery() or + TGotoShallReferenceALabelInSurroundingBlockQuery() or + TGotoShallJumpToLabelDeclaredLaterInTheFunctionQuery() or + TFunctionDeclaredWithTheNoreturnAttributeReturnQuery() or + TNonVoidFunctionShallReturnAValueOnAllPathsQuery() + +predicate isImportMisra23QueryMetadata(Query query, string queryId, string ruleId, string category) { + query = + // `Query` instance for the `userCopyAndMoveAssignmentShallHandleSelfAssignment` query + ImportMisra23Package::userCopyAndMoveAssignmentShallHandleSelfAssignmentQuery() and + queryId = + // `@id` for the `userCopyAndMoveAssignmentShallHandleSelfAssignment` query + "cpp/misra/user-copy-and-move-assignment-shall-handle-self-assignment" and + ruleId = "DIR-15-8-1" and + category = "required" + or + query = + // `Query` instance for the `sectionsOfCodeShouldNotBeCommentedOut` query + ImportMisra23Package::sectionsOfCodeShouldNotBeCommentedOutQuery() and + queryId = + // `@id` for the `sectionsOfCodeShouldNotBeCommentedOut` query + "cpp/misra/sections-of-code-should-not-be-commented-out" and + ruleId = "DIR-5-7-2" and + category = "advisory" + or + query = + // `Query` instance for the `declarationShouldNotDeclareMoreThanOneVariable` query + ImportMisra23Package::declarationShouldNotDeclareMoreThanOneVariableQuery() and + queryId = + // `@id` for the `declarationShouldNotDeclareMoreThanOneVariable` query + "cpp/misra/declaration-should-not-declare-more-than-one-variable" and + ruleId = "RULE-10-0-1" and + category = "advisory" + or + query = + // `Query` instance for the `enumerationNotDefinedWithAnExplicitUnderlyingType` query + ImportMisra23Package::enumerationNotDefinedWithAnExplicitUnderlyingTypeQuery() and + queryId = + // `@id` for the `enumerationNotDefinedWithAnExplicitUnderlyingType` query + "cpp/misra/enumeration-not-defined-with-an-explicit-underlying-type" and + ruleId = "RULE-10-2-1" and + category = "required" + or + query = + // `Query` instance for the `asmDeclarationShallNotBeUsed` query + ImportMisra23Package::asmDeclarationShallNotBeUsedQuery() and + queryId = + // `@id` for the `asmDeclarationShallNotBeUsed` query + "cpp/misra/asm-declaration-shall-not-be-used" and + ruleId = "RULE-10-4-1" and + category = "required" + or + query = + // `Query` instance for the `declarationOfAnObjectIndirectionsLevel` query + ImportMisra23Package::declarationOfAnObjectIndirectionsLevelQuery() and + queryId = + // `@id` for the `declarationOfAnObjectIndirectionsLevel` query + "cpp/misra/declaration-of-an-object-indirections-level" and + ruleId = "RULE-11-3-2" and + category = "advisory" + or + query = + // `Query` instance for the `valueOfAnEnumerationConstantNotUnique` query + ImportMisra23Package::valueOfAnEnumerationConstantNotUniqueQuery() and + queryId = + // `@id` for the `valueOfAnEnumerationConstantNotUnique` query + "cpp/misra/value-of-an-enumeration-constant-not-unique" and + ruleId = "RULE-11-6-3" and + category = "required" + or + query = + // `Query` instance for the `bitFieldShallHaveAnAppropriateType` query + ImportMisra23Package::bitFieldShallHaveAnAppropriateTypeQuery() and + queryId = + // `@id` for the `bitFieldShallHaveAnAppropriateType` query + "cpp/misra/bit-field-shall-have-an-appropriate-type" and + ruleId = "RULE-12-2-2" and + category = "required" + or + query = + // `Query` instance for the `signedIntegerBitFieldHaveALengthOfOneBit` query + ImportMisra23Package::signedIntegerBitFieldHaveALengthOfOneBitQuery() and + queryId = + // `@id` for the `signedIntegerBitFieldHaveALengthOfOneBit` query + "cpp/misra/signed-integer-bit-field-have-a-length-of-one-bit" and + ruleId = "RULE-12-2-3" and + category = "required" + or + query = + // `Query` instance for the `virtualAndNonVirtualBaseClassInHierarchy` query + ImportMisra23Package::virtualAndNonVirtualBaseClassInHierarchyQuery() and + queryId = + // `@id` for the `virtualAndNonVirtualBaseClassInHierarchy` query + "cpp/misra/virtual-and-non-virtual-base-class-in-hierarchy" and + ruleId = "RULE-13-1-2" and + category = "required" + or + query = + // `Query` instance for the `differentDefaultArgsInOverridingVirtualFunction` query + ImportMisra23Package::differentDefaultArgsInOverridingVirtualFunctionQuery() and + queryId = + // `@id` for the `differentDefaultArgsInOverridingVirtualFunction` query + "cpp/misra/different-default-args-in-overriding-virtual-function" and + ruleId = "RULE-13-3-2" and + category = "required" + or + query = + // `Query` instance for the `declarationsOrOverridesParamsAreUnnamedOrIdentical` query + ImportMisra23Package::declarationsOrOverridesParamsAreUnnamedOrIdenticalQuery() and + queryId = + // `@id` for the `declarationsOrOverridesParamsAreUnnamedOrIdentical` query + "cpp/misra/declarations-or-overrides-params-are-unnamed-or-identical" and + ruleId = "RULE-13-3-3" and + category = "required" + or + query = + // `Query` instance for the `comparisonOfVirtualPointerOnlyBeWithNullptr` query + ImportMisra23Package::comparisonOfVirtualPointerOnlyBeWithNullptrQuery() and + queryId = + // `@id` for the `comparisonOfVirtualPointerOnlyBeWithNullptr` query + "cpp/misra/comparison-of-virtual-pointer-only-be-with-nullptr" and + ruleId = "RULE-13-3-4" and + category = "required" + or + query = + // `Query` instance for the `dynamicTypeUsedWithinConstructorOrDestructor` query + ImportMisra23Package::dynamicTypeUsedWithinConstructorOrDestructorQuery() and + queryId = + // `@id` for the `dynamicTypeUsedWithinConstructorOrDestructor` query + "cpp/misra/dynamic-type-used-within-constructor-or-destructor" and + ruleId = "RULE-15-1-1" and + category = "required" + or + query = + // `Query` instance for the `constructorsShouldInitializeAllBaseClasses` query + ImportMisra23Package::constructorsShouldInitializeAllBaseClassesQuery() and + queryId = + // `@id` for the `constructorsShouldInitializeAllBaseClasses` query + "cpp/misra/constructors-should-initialize-all-base-classes" and + ruleId = "RULE-15-1-2" and + category = "advisory" + or + query = + // `Query` instance for the `initializerListConstructorIsTheOnlyConstructor` query + ImportMisra23Package::initializerListConstructorIsTheOnlyConstructorQuery() and + queryId = + // `@id` for the `initializerListConstructorIsTheOnlyConstructor` query + "cpp/misra/initializer-list-constructor-is-the-only-constructor" and + ruleId = "RULE-15-1-5" and + category = "required" + or + query = + // `Query` instance for the `addressOfOperatorOverloaded` query + ImportMisra23Package::addressOfOperatorOverloadedQuery() and + queryId = + // `@id` for the `addressOfOperatorOverloaded` query + "cpp/misra/address-of-operator-overloaded" and + ruleId = "RULE-16-5-2" and + category = "required" + or + query = + // `Query` instance for the `functionTemplatesExplicitlySpecialized` query + ImportMisra23Package::functionTemplatesExplicitlySpecializedQuery() and + queryId = + // `@id` for the `functionTemplatesExplicitlySpecialized` query + "cpp/misra/function-templates-explicitly-specialized" and + ruleId = "RULE-17-8-1" and + category = "required" + or + query = + // `Query` instance for the `exceptionObjectHavePointerType` query + ImportMisra23Package::exceptionObjectHavePointerTypeQuery() and + queryId = + // `@id` for the `exceptionObjectHavePointerType` query + "cpp/misra/exception-object-have-pointer-type" and + ruleId = "RULE-18-1-1" and + category = "required" + or + query = + // `Query` instance for the `emptyThrowShallOnlyOccurWithinACatchHandler` query + ImportMisra23Package::emptyThrowShallOnlyOccurWithinACatchHandlerQuery() and + queryId = + // `@id` for the `emptyThrowShallOnlyOccurWithinACatchHandler` query + "cpp/misra/empty-throw-shall-only-occur-within-a-catch-handler" and + ruleId = "RULE-18-1-2" and + category = "required" + or + query = + // `Query` instance for the `handlersReferToNonStaticMembersFromTheirClass` query + ImportMisra23Package::handlersReferToNonStaticMembersFromTheirClassQuery() and + queryId = + // `@id` for the `handlersReferToNonStaticMembersFromTheirClass` query + "cpp/misra/handlers-refer-to-non-static-members-from-their-class" and + ruleId = "RULE-18-3-3" and + category = "required" + or + query = + // `Query` instance for the `noexceptFunctionShouldNotPropagateAnException` query + ImportMisra23Package::noexceptFunctionShouldNotPropagateAnExceptionQuery() and + queryId = + // `@id` for the `noexceptFunctionShouldNotPropagateAnException` query + "cpp/misra/noexcept-function-should-not-propagate-an-exception" and + ruleId = "RULE-18-5-1" and + category = "advisory" + or + query = + // `Query` instance for the `functionLikeMacrosDefined` query + ImportMisra23Package::functionLikeMacrosDefinedQuery() and + queryId = + // `@id` for the `functionLikeMacrosDefined` query + "cpp/misra/function-like-macros-defined" and + ruleId = "RULE-19-0-2" and + category = "required" + or + query = + // `Query` instance for the `includeDirectivesPrecededByPreprocessorDirectives` query + ImportMisra23Package::includeDirectivesPrecededByPreprocessorDirectivesQuery() and + queryId = + // `@id` for the `includeDirectivesPrecededByPreprocessorDirectives` query + "cpp/misra/include-directives-preceded-by-preprocessor-directives" and + ruleId = "RULE-19-0-3" and + category = "advisory" + or + query = + // `Query` instance for the `identifiersUsedInTheControllingExpressionOf` query + ImportMisra23Package::identifiersUsedInTheControllingExpressionOfQuery() and + queryId = + // `@id` for the `identifiersUsedInTheControllingExpressionOf` query + "cpp/misra/identifiers-used-in-the-controlling-expression-of" and + ruleId = "RULE-19-1-3" and + category = "required" + or + query = + // `Query` instance for the `charsThatShouldNotOccurInHeaderFileName` query + ImportMisra23Package::charsThatShouldNotOccurInHeaderFileNameQuery() and + queryId = + // `@id` for the `charsThatShouldNotOccurInHeaderFileName` query + "cpp/misra/chars-that-should-not-occur-in-header-file-name" and + ruleId = "RULE-19-2-3" and + category = "required" + or + query = + // `Query` instance for the `andPreprocessorOperatorsShouldNotBeUsed` query + ImportMisra23Package::andPreprocessorOperatorsShouldNotBeUsedQuery() and + queryId = + // `@id` for the `andPreprocessorOperatorsShouldNotBeUsed` query + "cpp/misra/and-preprocessor-operators-should-not-be-used" and + ruleId = "RULE-19-3-1" and + category = "advisory" + or + query = + // `Query` instance for the `macroParameterFollowingAHashOperator` query + ImportMisra23Package::macroParameterFollowingAHashOperatorQuery() and + queryId = + // `@id` for the `macroParameterFollowingAHashOperator` query + "cpp/misra/macro-parameter-following-a-hash-operator" and + ruleId = "RULE-19-3-2" and + category = "required" + or + query = + // `Query` instance for the `argumentToAMixedUseMacroShoulNotNeedExpansion` query + ImportMisra23Package::argumentToAMixedUseMacroShoulNotNeedExpansionQuery() and + queryId = + // `@id` for the `argumentToAMixedUseMacroShoulNotNeedExpansion` query + "cpp/misra/argument-to-a-mixed-use-macro-shoul-not-need-expansion" and + ruleId = "RULE-19-3-3" and + category = "required" + or + query = + // `Query` instance for the `tokensThatLookLikeDirectivesInAMacroArgument` query + ImportMisra23Package::tokensThatLookLikeDirectivesInAMacroArgumentQuery() and + queryId = + // `@id` for the `tokensThatLookLikeDirectivesInAMacroArgument` query + "cpp/misra/tokens-that-look-like-directives-in-a-macro-argument" and + ruleId = "RULE-19-3-5" and + category = "required" + or + query = + // `Query` instance for the `facilitiesProvidedByCsignalUsed` query + ImportMisra23Package::facilitiesProvidedByCsignalUsedQuery() and + queryId = + // `@id` for the `facilitiesProvidedByCsignalUsed` query + "cpp/misra/facilities-provided-by-csignal-used" and + ruleId = "RULE-21-10-3" and + category = "required" + or + query = + // `Query` instance for the `atofAtoiAtolAndAtollFromCstdlibUsed` query + ImportMisra23Package::atofAtoiAtolAndAtollFromCstdlibUsedQuery() and + queryId = + // `@id` for the `atofAtoiAtolAndAtollFromCstdlibUsed` query + "cpp/misra/atof-atoi-atol-and-atoll-from-cstdlib-used" and + ruleId = "RULE-21-2-1" and + category = "required" + or + query = + // `Query` instance for the `macroOffsetShouldNotBeUsed` query + ImportMisra23Package::macroOffsetShouldNotBeUsedQuery() and + queryId = + // `@id` for the `macroOffsetShouldNotBeUsed` query + "cpp/misra/macro-offset-should-not-be-used" and + ruleId = "RULE-21-2-4" and + category = "required" + or + query = + // `Query` instance for the `defineBothSizedAndUnsizedVersionOfAGlobalOperator` query + ImportMisra23Package::defineBothSizedAndUnsizedVersionOfAGlobalOperatorQuery() and + queryId = + // `@id` for the `defineBothSizedAndUnsizedVersionOfAGlobalOperator` query + "cpp/misra/define-both-sized-and-unsized-version-of-a-global-operator" and + ruleId = "RULE-21-6-4" and + category = "required" + or + query = + // `Query` instance for the `pointerToAnIncompleteClassTypeDeleted` query + ImportMisra23Package::pointerToAnIncompleteClassTypeDeletedQuery() and + queryId = + // `@id` for the `pointerToAnIncompleteClassTypeDeleted` query + "cpp/misra/pointer-to-an-incomplete-class-type-deleted" and + ruleId = "RULE-21-6-5" and + category = "required" + or + query = + // `Query` instance for the `pointersReturnedByLocaleFunctionsMustBeUsedAsConst` query + ImportMisra23Package::pointersReturnedByLocaleFunctionsMustBeUsedAsConstQuery() and + queryId = + // `@id` for the `pointersReturnedByLocaleFunctionsMustBeUsedAsConst` query + "cpp/misra/pointers-returned-by-locale-functions-must-be-used-as-const" and + ruleId = "RULE-25-5-2" and + category = "mandatory" + or + query = + // `Query` instance for the `callToSetlocaleInvalidatesOldPointersMisra` query + ImportMisra23Package::callToSetlocaleInvalidatesOldPointersMisraQuery() and + queryId = + // `@id` for the `callToSetlocaleInvalidatesOldPointersMisra` query + "cpp/misra/call-to-setlocale-invalidates-old-pointers-misra" and + ruleId = "RULE-25-5-3" and + category = "mandatory" + or + query = + // `Query` instance for the `callToSetlocaleInvalidatesOldPointersWarnMisra` query + ImportMisra23Package::callToSetlocaleInvalidatesOldPointersWarnMisraQuery() and + queryId = + // `@id` for the `callToSetlocaleInvalidatesOldPointersWarnMisra` query + "cpp/misra/call-to-setlocale-invalidates-old-pointers-warn-misra" and + ruleId = "RULE-25-5-3" and + category = "mandatory" + or + query = + // `Query` instance for the `vectorShouldNotBeSpecializedWithBool` query + ImportMisra23Package::vectorShouldNotBeSpecializedWithBoolQuery() and + queryId = + // `@id` for the `vectorShouldNotBeSpecializedWithBool` query + "cpp/misra/vector-should-not-be-specialized-with-bool" and + ruleId = "RULE-26-3-1" and + category = "advisory" + or + query = + // `Query` instance for the `forwardingReferencesAndForwardNotUsedTogether` query + ImportMisra23Package::forwardingReferencesAndForwardNotUsedTogetherQuery() and + queryId = + // `@id` for the `forwardingReferencesAndForwardNotUsedTogether` query + "cpp/misra/forwarding-references-and-forward-not-used-together" and + ruleId = "RULE-28-6-2" and + category = "required" + or + query = + // `Query` instance for the `objectUsedWhileInPotentiallyMovedFromState` query + ImportMisra23Package::objectUsedWhileInPotentiallyMovedFromStateQuery() and + queryId = + // `@id` for the `objectUsedWhileInPotentiallyMovedFromState` query + "cpp/misra/object-used-while-in-potentially-moved-from-state" and + ruleId = "RULE-28-6-3" and + category = "required" + or + query = + // `Query` instance for the `cLibraryInputoutputFunctionsUsed` query + ImportMisra23Package::cLibraryInputoutputFunctionsUsedQuery() and + queryId = + // `@id` for the `cLibraryInputoutputFunctionsUsed` query + "cpp/misra/c-library-inputoutput-functions-used" and + ruleId = "RULE-30-0-1" and + category = "required" + or + query = + // `Query` instance for the `readsAndWritesOnStreamNotSeparatedByPositioning` query + ImportMisra23Package::readsAndWritesOnStreamNotSeparatedByPositioningQuery() and + queryId = + // `@id` for the `readsAndWritesOnStreamNotSeparatedByPositioning` query + "cpp/misra/reads-and-writes-on-stream-not-separated-by-positioning" and + ruleId = "RULE-30-0-2" and + category = "required" + or + query = + // `Query` instance for the `operationsOnMemoryNotSequencedAppropriately` query + ImportMisra23Package::operationsOnMemoryNotSequencedAppropriatelyQuery() and + queryId = + // `@id` for the `operationsOnMemoryNotSequencedAppropriately` query + "cpp/misra/operations-on-memory-not-sequenced-appropriately" and + ruleId = "RULE-4-6-1" and + category = "required" + or + query = + // `Query` instance for the `characterOnlyInEscapeSequenceOrUniversalCharName` query + ImportMisra23Package::characterOnlyInEscapeSequenceOrUniversalCharNameQuery() and + queryId = + // `@id` for the `characterOnlyInEscapeSequenceOrUniversalCharName` query + "cpp/misra/character-only-in-escape-sequence-or-universal-char-name" and + ruleId = "RULE-5-13-1" and + category = "required" + or + query = + // `Query` instance for the `escapeSequencesAndUniversalCharNamesNotTerminated` query + ImportMisra23Package::escapeSequencesAndUniversalCharNamesNotTerminatedQuery() and + queryId = + // `@id` for the `escapeSequencesAndUniversalCharNamesNotTerminated` query + "cpp/misra/escape-sequences-and-universal-char-names-not-terminated" and + ruleId = "RULE-5-13-2" and + category = "required" + or + query = + // `Query` instance for the `octalConstantsUsed` query + ImportMisra23Package::octalConstantsUsedQuery() and + queryId = + // `@id` for the `octalConstantsUsed` query + "cpp/misra/octal-constants-used" and + ruleId = "RULE-5-13-3" and + category = "required" + or + query = + // `Query` instance for the `unsignedIntegerLiteralsNotAppropriatelySuffixed` query + ImportMisra23Package::unsignedIntegerLiteralsNotAppropriatelySuffixedQuery() and + queryId = + // `@id` for the `unsignedIntegerLiteralsNotAppropriatelySuffixed` query + "cpp/misra/unsigned-integer-literals-not-appropriately-suffixed" and + ruleId = "RULE-5-13-4" and + category = "required" + or + query = + // `Query` instance for the `lowercaseLUsedAsFirstCharacterInLiteralSuffix` query + ImportMisra23Package::lowercaseLUsedAsFirstCharacterInLiteralSuffixQuery() and + queryId = + // `@id` for the `lowercaseLUsedAsFirstCharacterInLiteralSuffix` query + "cpp/misra/lowercase-l-used-as-first-character-in-literal-suffix" and + ruleId = "RULE-5-13-5" and + category = "required" + or + query = + // `Query` instance for the `characterSequenceUsedWithinACStyleComment` query + ImportMisra23Package::characterSequenceUsedWithinACStyleCommentQuery() and + queryId = + // `@id` for the `characterSequenceUsedWithinACStyleComment` query + "cpp/misra/character-sequence-used-within-ac-style-comment" and + ruleId = "RULE-5-7-1" and + category = "required" + or + query = + // `Query` instance for the `lineSplicingUsedInComments` query + ImportMisra23Package::lineSplicingUsedInCommentsQuery() and + queryId = + // `@id` for the `lineSplicingUsedInComments` query + "cpp/misra/line-splicing-used-in-comments" and + ruleId = "RULE-5-7-3" and + category = "required" + or + query = + // `Query` instance for the `globalDeclarationsOnlyMainNamespaceOrExternC` query + ImportMisra23Package::globalDeclarationsOnlyMainNamespaceOrExternCQuery() and + queryId = + // `@id` for the `globalDeclarationsOnlyMainNamespaceOrExternC` query + "cpp/misra/global-declarations-only-main-namespace-or-extern-c" and + ruleId = "RULE-6-0-3" and + category = "advisory" + or + query = + // `Query` instance for the `mainUsedOnlyForTheGlobalFunctionMain` query + ImportMisra23Package::mainUsedOnlyForTheGlobalFunctionMainQuery() and + queryId = + // `@id` for the `mainUsedOnlyForTheGlobalFunctionMain` query + "cpp/misra/main-used-only-for-the-global-function-main" and + ruleId = "RULE-6-0-4" and + category = "required" + or + query = + // `Query` instance for the `oneDefinitionRuleViolated` query + ImportMisra23Package::oneDefinitionRuleViolatedQuery() and + queryId = + // `@id` for the `oneDefinitionRuleViolated` query + "cpp/misra/one-definition-rule-violated" and + ruleId = "RULE-6-2-1" and + category = "required" + or + query = + // `Query` instance for the `variableDeclaredInInnerScopeHidesOuterScope` query + ImportMisra23Package::variableDeclaredInInnerScopeHidesOuterScopeQuery() and + queryId = + // `@id` for the `variableDeclaredInInnerScopeHidesOuterScope` query + "cpp/misra/variable-declared-in-inner-scope-hides-outer-scope" and + ruleId = "RULE-6-4-1" and + category = "required" + or + query = + // `Query` instance for the `derivedClasseConcealFunctionInheritedFromTheBase` query + ImportMisra23Package::derivedClasseConcealFunctionInheritedFromTheBaseQuery() and + queryId = + // `@id` for the `derivedClasseConcealFunctionInheritedFromTheBase` query + "cpp/misra/derived-classe-conceal-function-inherited-from-the-base" and + ruleId = "RULE-6-4-2" and + category = "required" + or + query = + // `Query` instance for the `nameInDependentBaseResolvedByUnqualifiedLookup` query + ImportMisra23Package::nameInDependentBaseResolvedByUnqualifiedLookupQuery() and + queryId = + // `@id` for the `nameInDependentBaseResolvedByUnqualifiedLookup` query + "cpp/misra/name-in-dependent-base-resolved-by-unqualified-lookup" and + ruleId = "RULE-6-4-3" and + category = "required" + or + query = + // `Query` instance for the `objectAccessedBeforeLifetimeMisra` query + ImportMisra23Package::objectAccessedBeforeLifetimeMisraQuery() and + queryId = + // `@id` for the `objectAccessedBeforeLifetimeMisra` query + "cpp/misra/object-accessed-before-lifetime-misra" and + ruleId = "RULE-6-8-1" and + category = "required" + or + query = + // `Query` instance for the `objectAccessedAfterLifetimeMisra` query + ImportMisra23Package::objectAccessedAfterLifetimeMisraQuery() and + queryId = + // `@id` for the `objectAccessedAfterLifetimeMisra` query + "cpp/misra/object-accessed-after-lifetime-misra" and + ruleId = "RULE-6-8-1" and + category = "required" + or + query = + // `Query` instance for the `mustNotReturnReferenceToLocalAutomaticVariable` query + ImportMisra23Package::mustNotReturnReferenceToLocalAutomaticVariableQuery() and + queryId = + // `@id` for the `mustNotReturnReferenceToLocalAutomaticVariable` query + "cpp/misra/must-not-return-reference-to-local-automatic-variable" and + ruleId = "RULE-6-8-2" and + category = "mandatory" + or + query = + // `Query` instance for the `nullptrNotTheOnlyFormOfTheNullPointerConstant` query + ImportMisra23Package::nullptrNotTheOnlyFormOfTheNullPointerConstantQuery() and + queryId = + // `@id` for the `nullptrNotTheOnlyFormOfTheNullPointerConstant` query + "cpp/misra/nullptr-not-the-only-form-of-the-null-pointer-constant" and + ruleId = "RULE-7-11-1" and + category = "required" + or + query = + // `Query` instance for the `arrayPassedAsFunctionArgumentDecayToAPointer` query + ImportMisra23Package::arrayPassedAsFunctionArgumentDecayToAPointerQuery() and + queryId = + // `@id` for the `arrayPassedAsFunctionArgumentDecayToAPointer` query + "cpp/misra/array-passed-as-function-argument-decay-to-a-pointer" and + ruleId = "RULE-7-11-2" and + category = "required" + or + query = + // `Query` instance for the `resultOfAnAssignmentOperatorShouldNotBeUsed` query + ImportMisra23Package::resultOfAnAssignmentOperatorShouldNotBeUsedQuery() and + queryId = + // `@id` for the `resultOfAnAssignmentOperatorShouldNotBeUsed` query + "cpp/misra/result-of-an-assignment-operator-should-not-be-used" and + ruleId = "RULE-8-18-2" and + category = "advisory" + or + query = + // `Query` instance for the `commaOperatorShouldNotBeUsed` query + ImportMisra23Package::commaOperatorShouldNotBeUsedQuery() and + queryId = + // `@id` for the `commaOperatorShouldNotBeUsed` query + "cpp/misra/comma-operator-should-not-be-used" and + ruleId = "RULE-8-19-1" and + category = "advisory" + or + query = + // `Query` instance for the `functionsCallThemselvesEitherDirectlyOrIndirectly` query + ImportMisra23Package::functionsCallThemselvesEitherDirectlyOrIndirectlyQuery() and + queryId = + // `@id` for the `functionsCallThemselvesEitherDirectlyOrIndirectly` query + "cpp/misra/functions-call-themselves-either-directly-or-indirectly" and + ruleId = "RULE-8-2-10" and + category = "required" + or + query = + // `Query` instance for the `castRemovesConstOrVolatileFromPointerOrReference` query + ImportMisra23Package::castRemovesConstOrVolatileFromPointerOrReferenceQuery() and + queryId = + // `@id` for the `castRemovesConstOrVolatileFromPointerOrReference` query + "cpp/misra/cast-removes-const-or-volatile-from-pointer-or-reference" and + ruleId = "RULE-8-2-3" and + category = "required" + or + query = + // `Query` instance for the `castsBetweenAPointerToFunctionAndAnyOtherType` query + ImportMisra23Package::castsBetweenAPointerToFunctionAndAnyOtherTypeQuery() and + queryId = + // `@id` for the `castsBetweenAPointerToFunctionAndAnyOtherType` query + "cpp/misra/casts-between-a-pointer-to-function-and-any-other-type" and + ruleId = "RULE-8-2-4" and + category = "required" + or + query = + // `Query` instance for the `reinterpretCastShallNotBeUsed` query + ImportMisra23Package::reinterpretCastShallNotBeUsedQuery() and + queryId = + // `@id` for the `reinterpretCastShallNotBeUsed` query + "cpp/misra/reinterpret-cast-shall-not-be-used" and + ruleId = "RULE-8-2-5" and + category = "required" + or + query = + // `Query` instance for the `unsignedOperationWithConstantOperandsShouldNotWrap` query + ImportMisra23Package::unsignedOperationWithConstantOperandsShouldNotWrapQuery() and + queryId = + // `@id` for the `unsignedOperationWithConstantOperandsShouldNotWrap` query + "cpp/misra/unsigned-operation-with-constant-operands-should-not-wrap" and + ruleId = "RULE-8-20-1" and + category = "advisory" + or + query = + // `Query` instance for the `builtInOperatorAppliedToUnsignedExpression` query + ImportMisra23Package::builtInOperatorAppliedToUnsignedExpressionQuery() and + queryId = + // `@id` for the `builtInOperatorAppliedToUnsignedExpression` query + "cpp/misra/built-in-operator-applied-to-unsigned-expression" and + ruleId = "RULE-8-3-1" and + category = "advisory" + or + query = + // `Query` instance for the `bodyOfIterationOrSelectionStatementNotCompound` query + ImportMisra23Package::bodyOfIterationOrSelectionStatementNotCompoundQuery() and + queryId = + // `@id` for the `bodyOfIterationOrSelectionStatementNotCompound` query + "cpp/misra/body-of-iteration-or-selection-statement-not-compound" and + ruleId = "RULE-9-3-1" and + category = "required" + or + query = + // `Query` instance for the `ifElseIfEndCondition` query + ImportMisra23Package::ifElseIfEndConditionQuery() and + queryId = + // `@id` for the `ifElseIfEndCondition` query + "cpp/misra/if-else-if-end-condition" and + ruleId = "RULE-9-4-1" and + category = "required" + or + query = + // `Query` instance for the `gotoStatementShouldNotBeUsed` query + ImportMisra23Package::gotoStatementShouldNotBeUsedQuery() and + queryId = + // `@id` for the `gotoStatementShouldNotBeUsed` query + "cpp/misra/goto-statement-should-not-be-used" and + ruleId = "RULE-9-6-1" and + category = "advisory" + or + query = + // `Query` instance for the `gotoShallReferenceALabelInSurroundingBlock` query + ImportMisra23Package::gotoShallReferenceALabelInSurroundingBlockQuery() and + queryId = + // `@id` for the `gotoShallReferenceALabelInSurroundingBlock` query + "cpp/misra/goto-shall-reference-a-label-in-surrounding-block" and + ruleId = "RULE-9-6-2" and + category = "required" + or + query = + // `Query` instance for the `gotoShallJumpToLabelDeclaredLaterInTheFunction` query + ImportMisra23Package::gotoShallJumpToLabelDeclaredLaterInTheFunctionQuery() and + queryId = + // `@id` for the `gotoShallJumpToLabelDeclaredLaterInTheFunction` query + "cpp/misra/goto-shall-jump-to-label-declared-later-in-the-function" and + ruleId = "RULE-9-6-3" and + category = "required" + or + query = + // `Query` instance for the `functionDeclaredWithTheNoreturnAttributeReturn` query + ImportMisra23Package::functionDeclaredWithTheNoreturnAttributeReturnQuery() and + queryId = + // `@id` for the `functionDeclaredWithTheNoreturnAttributeReturn` query + "cpp/misra/function-declared-with-the-noreturn-attribute-return" and + ruleId = "RULE-9-6-4" and + category = "required" + or + query = + // `Query` instance for the `nonVoidFunctionShallReturnAValueOnAllPaths` query + ImportMisra23Package::nonVoidFunctionShallReturnAValueOnAllPathsQuery() and + queryId = + // `@id` for the `nonVoidFunctionShallReturnAValueOnAllPaths` query + "cpp/misra/non-void-function-shall-return-a-value-on-all-paths" and + ruleId = "RULE-9-6-5" and + category = "required" +} + +module ImportMisra23Package { + Query userCopyAndMoveAssignmentShallHandleSelfAssignmentQuery() { + //autogenerate `Query` type + result = + // `Query` type for `userCopyAndMoveAssignmentShallHandleSelfAssignment` query + TQueryCPP(TImportMisra23PackageQuery(TUserCopyAndMoveAssignmentShallHandleSelfAssignmentQuery())) + } + + Query sectionsOfCodeShouldNotBeCommentedOutQuery() { + //autogenerate `Query` type + result = + // `Query` type for `sectionsOfCodeShouldNotBeCommentedOut` query + TQueryCPP(TImportMisra23PackageQuery(TSectionsOfCodeShouldNotBeCommentedOutQuery())) + } + + Query declarationShouldNotDeclareMoreThanOneVariableQuery() { + //autogenerate `Query` type + result = + // `Query` type for `declarationShouldNotDeclareMoreThanOneVariable` query + TQueryCPP(TImportMisra23PackageQuery(TDeclarationShouldNotDeclareMoreThanOneVariableQuery())) + } + + Query enumerationNotDefinedWithAnExplicitUnderlyingTypeQuery() { + //autogenerate `Query` type + result = + // `Query` type for `enumerationNotDefinedWithAnExplicitUnderlyingType` query + TQueryCPP(TImportMisra23PackageQuery(TEnumerationNotDefinedWithAnExplicitUnderlyingTypeQuery())) + } + + Query asmDeclarationShallNotBeUsedQuery() { + //autogenerate `Query` type + result = + // `Query` type for `asmDeclarationShallNotBeUsed` query + TQueryCPP(TImportMisra23PackageQuery(TAsmDeclarationShallNotBeUsedQuery())) + } + + Query declarationOfAnObjectIndirectionsLevelQuery() { + //autogenerate `Query` type + result = + // `Query` type for `declarationOfAnObjectIndirectionsLevel` query + TQueryCPP(TImportMisra23PackageQuery(TDeclarationOfAnObjectIndirectionsLevelQuery())) + } + + Query valueOfAnEnumerationConstantNotUniqueQuery() { + //autogenerate `Query` type + result = + // `Query` type for `valueOfAnEnumerationConstantNotUnique` query + TQueryCPP(TImportMisra23PackageQuery(TValueOfAnEnumerationConstantNotUniqueQuery())) + } + + Query bitFieldShallHaveAnAppropriateTypeQuery() { + //autogenerate `Query` type + result = + // `Query` type for `bitFieldShallHaveAnAppropriateType` query + TQueryCPP(TImportMisra23PackageQuery(TBitFieldShallHaveAnAppropriateTypeQuery())) + } + + Query signedIntegerBitFieldHaveALengthOfOneBitQuery() { + //autogenerate `Query` type + result = + // `Query` type for `signedIntegerBitFieldHaveALengthOfOneBit` query + TQueryCPP(TImportMisra23PackageQuery(TSignedIntegerBitFieldHaveALengthOfOneBitQuery())) + } + + Query virtualAndNonVirtualBaseClassInHierarchyQuery() { + //autogenerate `Query` type + result = + // `Query` type for `virtualAndNonVirtualBaseClassInHierarchy` query + TQueryCPP(TImportMisra23PackageQuery(TVirtualAndNonVirtualBaseClassInHierarchyQuery())) + } + + Query differentDefaultArgsInOverridingVirtualFunctionQuery() { + //autogenerate `Query` type + result = + // `Query` type for `differentDefaultArgsInOverridingVirtualFunction` query + TQueryCPP(TImportMisra23PackageQuery(TDifferentDefaultArgsInOverridingVirtualFunctionQuery())) + } + + Query declarationsOrOverridesParamsAreUnnamedOrIdenticalQuery() { + //autogenerate `Query` type + result = + // `Query` type for `declarationsOrOverridesParamsAreUnnamedOrIdentical` query + TQueryCPP(TImportMisra23PackageQuery(TDeclarationsOrOverridesParamsAreUnnamedOrIdenticalQuery())) + } + + Query comparisonOfVirtualPointerOnlyBeWithNullptrQuery() { + //autogenerate `Query` type + result = + // `Query` type for `comparisonOfVirtualPointerOnlyBeWithNullptr` query + TQueryCPP(TImportMisra23PackageQuery(TComparisonOfVirtualPointerOnlyBeWithNullptrQuery())) + } + + Query dynamicTypeUsedWithinConstructorOrDestructorQuery() { + //autogenerate `Query` type + result = + // `Query` type for `dynamicTypeUsedWithinConstructorOrDestructor` query + TQueryCPP(TImportMisra23PackageQuery(TDynamicTypeUsedWithinConstructorOrDestructorQuery())) + } + + Query constructorsShouldInitializeAllBaseClassesQuery() { + //autogenerate `Query` type + result = + // `Query` type for `constructorsShouldInitializeAllBaseClasses` query + TQueryCPP(TImportMisra23PackageQuery(TConstructorsShouldInitializeAllBaseClassesQuery())) + } + + Query initializerListConstructorIsTheOnlyConstructorQuery() { + //autogenerate `Query` type + result = + // `Query` type for `initializerListConstructorIsTheOnlyConstructor` query + TQueryCPP(TImportMisra23PackageQuery(TInitializerListConstructorIsTheOnlyConstructorQuery())) + } + + Query addressOfOperatorOverloadedQuery() { + //autogenerate `Query` type + result = + // `Query` type for `addressOfOperatorOverloaded` query + TQueryCPP(TImportMisra23PackageQuery(TAddressOfOperatorOverloadedQuery())) + } + + Query functionTemplatesExplicitlySpecializedQuery() { + //autogenerate `Query` type + result = + // `Query` type for `functionTemplatesExplicitlySpecialized` query + TQueryCPP(TImportMisra23PackageQuery(TFunctionTemplatesExplicitlySpecializedQuery())) + } + + Query exceptionObjectHavePointerTypeQuery() { + //autogenerate `Query` type + result = + // `Query` type for `exceptionObjectHavePointerType` query + TQueryCPP(TImportMisra23PackageQuery(TExceptionObjectHavePointerTypeQuery())) + } + + Query emptyThrowShallOnlyOccurWithinACatchHandlerQuery() { + //autogenerate `Query` type + result = + // `Query` type for `emptyThrowShallOnlyOccurWithinACatchHandler` query + TQueryCPP(TImportMisra23PackageQuery(TEmptyThrowShallOnlyOccurWithinACatchHandlerQuery())) + } + + Query handlersReferToNonStaticMembersFromTheirClassQuery() { + //autogenerate `Query` type + result = + // `Query` type for `handlersReferToNonStaticMembersFromTheirClass` query + TQueryCPP(TImportMisra23PackageQuery(THandlersReferToNonStaticMembersFromTheirClassQuery())) + } + + Query noexceptFunctionShouldNotPropagateAnExceptionQuery() { + //autogenerate `Query` type + result = + // `Query` type for `noexceptFunctionShouldNotPropagateAnException` query + TQueryCPP(TImportMisra23PackageQuery(TNoexceptFunctionShouldNotPropagateAnExceptionQuery())) + } + + Query functionLikeMacrosDefinedQuery() { + //autogenerate `Query` type + result = + // `Query` type for `functionLikeMacrosDefined` query + TQueryCPP(TImportMisra23PackageQuery(TFunctionLikeMacrosDefinedQuery())) + } + + Query includeDirectivesPrecededByPreprocessorDirectivesQuery() { + //autogenerate `Query` type + result = + // `Query` type for `includeDirectivesPrecededByPreprocessorDirectives` query + TQueryCPP(TImportMisra23PackageQuery(TIncludeDirectivesPrecededByPreprocessorDirectivesQuery())) + } + + Query identifiersUsedInTheControllingExpressionOfQuery() { + //autogenerate `Query` type + result = + // `Query` type for `identifiersUsedInTheControllingExpressionOf` query + TQueryCPP(TImportMisra23PackageQuery(TIdentifiersUsedInTheControllingExpressionOfQuery())) + } + + Query charsThatShouldNotOccurInHeaderFileNameQuery() { + //autogenerate `Query` type + result = + // `Query` type for `charsThatShouldNotOccurInHeaderFileName` query + TQueryCPP(TImportMisra23PackageQuery(TCharsThatShouldNotOccurInHeaderFileNameQuery())) + } + + Query andPreprocessorOperatorsShouldNotBeUsedQuery() { + //autogenerate `Query` type + result = + // `Query` type for `andPreprocessorOperatorsShouldNotBeUsed` query + TQueryCPP(TImportMisra23PackageQuery(TAndPreprocessorOperatorsShouldNotBeUsedQuery())) + } + + Query macroParameterFollowingAHashOperatorQuery() { + //autogenerate `Query` type + result = + // `Query` type for `macroParameterFollowingAHashOperator` query + TQueryCPP(TImportMisra23PackageQuery(TMacroParameterFollowingAHashOperatorQuery())) + } + + Query argumentToAMixedUseMacroShoulNotNeedExpansionQuery() { + //autogenerate `Query` type + result = + // `Query` type for `argumentToAMixedUseMacroShoulNotNeedExpansion` query + TQueryCPP(TImportMisra23PackageQuery(TArgumentToAMixedUseMacroShoulNotNeedExpansionQuery())) + } + + Query tokensThatLookLikeDirectivesInAMacroArgumentQuery() { + //autogenerate `Query` type + result = + // `Query` type for `tokensThatLookLikeDirectivesInAMacroArgument` query + TQueryCPP(TImportMisra23PackageQuery(TTokensThatLookLikeDirectivesInAMacroArgumentQuery())) + } + + Query facilitiesProvidedByCsignalUsedQuery() { + //autogenerate `Query` type + result = + // `Query` type for `facilitiesProvidedByCsignalUsed` query + TQueryCPP(TImportMisra23PackageQuery(TFacilitiesProvidedByCsignalUsedQuery())) + } + + Query atofAtoiAtolAndAtollFromCstdlibUsedQuery() { + //autogenerate `Query` type + result = + // `Query` type for `atofAtoiAtolAndAtollFromCstdlibUsed` query + TQueryCPP(TImportMisra23PackageQuery(TAtofAtoiAtolAndAtollFromCstdlibUsedQuery())) + } + + Query macroOffsetShouldNotBeUsedQuery() { + //autogenerate `Query` type + result = + // `Query` type for `macroOffsetShouldNotBeUsed` query + TQueryCPP(TImportMisra23PackageQuery(TMacroOffsetShouldNotBeUsedQuery())) + } + + Query defineBothSizedAndUnsizedVersionOfAGlobalOperatorQuery() { + //autogenerate `Query` type + result = + // `Query` type for `defineBothSizedAndUnsizedVersionOfAGlobalOperator` query + TQueryCPP(TImportMisra23PackageQuery(TDefineBothSizedAndUnsizedVersionOfAGlobalOperatorQuery())) + } + + Query pointerToAnIncompleteClassTypeDeletedQuery() { + //autogenerate `Query` type + result = + // `Query` type for `pointerToAnIncompleteClassTypeDeleted` query + TQueryCPP(TImportMisra23PackageQuery(TPointerToAnIncompleteClassTypeDeletedQuery())) + } + + Query pointersReturnedByLocaleFunctionsMustBeUsedAsConstQuery() { + //autogenerate `Query` type + result = + // `Query` type for `pointersReturnedByLocaleFunctionsMustBeUsedAsConst` query + TQueryCPP(TImportMisra23PackageQuery(TPointersReturnedByLocaleFunctionsMustBeUsedAsConstQuery())) + } + + Query callToSetlocaleInvalidatesOldPointersMisraQuery() { + //autogenerate `Query` type + result = + // `Query` type for `callToSetlocaleInvalidatesOldPointersMisra` query + TQueryCPP(TImportMisra23PackageQuery(TCallToSetlocaleInvalidatesOldPointersMisraQuery())) + } + + Query callToSetlocaleInvalidatesOldPointersWarnMisraQuery() { + //autogenerate `Query` type + result = + // `Query` type for `callToSetlocaleInvalidatesOldPointersWarnMisra` query + TQueryCPP(TImportMisra23PackageQuery(TCallToSetlocaleInvalidatesOldPointersWarnMisraQuery())) + } + + Query vectorShouldNotBeSpecializedWithBoolQuery() { + //autogenerate `Query` type + result = + // `Query` type for `vectorShouldNotBeSpecializedWithBool` query + TQueryCPP(TImportMisra23PackageQuery(TVectorShouldNotBeSpecializedWithBoolQuery())) + } + + Query forwardingReferencesAndForwardNotUsedTogetherQuery() { + //autogenerate `Query` type + result = + // `Query` type for `forwardingReferencesAndForwardNotUsedTogether` query + TQueryCPP(TImportMisra23PackageQuery(TForwardingReferencesAndForwardNotUsedTogetherQuery())) + } + + Query objectUsedWhileInPotentiallyMovedFromStateQuery() { + //autogenerate `Query` type + result = + // `Query` type for `objectUsedWhileInPotentiallyMovedFromState` query + TQueryCPP(TImportMisra23PackageQuery(TObjectUsedWhileInPotentiallyMovedFromStateQuery())) + } + + Query cLibraryInputoutputFunctionsUsedQuery() { + //autogenerate `Query` type + result = + // `Query` type for `cLibraryInputoutputFunctionsUsed` query + TQueryCPP(TImportMisra23PackageQuery(TCLibraryInputoutputFunctionsUsedQuery())) + } + + Query readsAndWritesOnStreamNotSeparatedByPositioningQuery() { + //autogenerate `Query` type + result = + // `Query` type for `readsAndWritesOnStreamNotSeparatedByPositioning` query + TQueryCPP(TImportMisra23PackageQuery(TReadsAndWritesOnStreamNotSeparatedByPositioningQuery())) + } + + Query operationsOnMemoryNotSequencedAppropriatelyQuery() { + //autogenerate `Query` type + result = + // `Query` type for `operationsOnMemoryNotSequencedAppropriately` query + TQueryCPP(TImportMisra23PackageQuery(TOperationsOnMemoryNotSequencedAppropriatelyQuery())) + } + + Query characterOnlyInEscapeSequenceOrUniversalCharNameQuery() { + //autogenerate `Query` type + result = + // `Query` type for `characterOnlyInEscapeSequenceOrUniversalCharName` query + TQueryCPP(TImportMisra23PackageQuery(TCharacterOnlyInEscapeSequenceOrUniversalCharNameQuery())) + } + + Query escapeSequencesAndUniversalCharNamesNotTerminatedQuery() { + //autogenerate `Query` type + result = + // `Query` type for `escapeSequencesAndUniversalCharNamesNotTerminated` query + TQueryCPP(TImportMisra23PackageQuery(TEscapeSequencesAndUniversalCharNamesNotTerminatedQuery())) + } + + Query octalConstantsUsedQuery() { + //autogenerate `Query` type + result = + // `Query` type for `octalConstantsUsed` query + TQueryCPP(TImportMisra23PackageQuery(TOctalConstantsUsedQuery())) + } + + Query unsignedIntegerLiteralsNotAppropriatelySuffixedQuery() { + //autogenerate `Query` type + result = + // `Query` type for `unsignedIntegerLiteralsNotAppropriatelySuffixed` query + TQueryCPP(TImportMisra23PackageQuery(TUnsignedIntegerLiteralsNotAppropriatelySuffixedQuery())) + } + + Query lowercaseLUsedAsFirstCharacterInLiteralSuffixQuery() { + //autogenerate `Query` type + result = + // `Query` type for `lowercaseLUsedAsFirstCharacterInLiteralSuffix` query + TQueryCPP(TImportMisra23PackageQuery(TLowercaseLUsedAsFirstCharacterInLiteralSuffixQuery())) + } + + Query characterSequenceUsedWithinACStyleCommentQuery() { + //autogenerate `Query` type + result = + // `Query` type for `characterSequenceUsedWithinACStyleComment` query + TQueryCPP(TImportMisra23PackageQuery(TCharacterSequenceUsedWithinACStyleCommentQuery())) + } + + Query lineSplicingUsedInCommentsQuery() { + //autogenerate `Query` type + result = + // `Query` type for `lineSplicingUsedInComments` query + TQueryCPP(TImportMisra23PackageQuery(TLineSplicingUsedInCommentsQuery())) + } + + Query globalDeclarationsOnlyMainNamespaceOrExternCQuery() { + //autogenerate `Query` type + result = + // `Query` type for `globalDeclarationsOnlyMainNamespaceOrExternC` query + TQueryCPP(TImportMisra23PackageQuery(TGlobalDeclarationsOnlyMainNamespaceOrExternCQuery())) + } + + Query mainUsedOnlyForTheGlobalFunctionMainQuery() { + //autogenerate `Query` type + result = + // `Query` type for `mainUsedOnlyForTheGlobalFunctionMain` query + TQueryCPP(TImportMisra23PackageQuery(TMainUsedOnlyForTheGlobalFunctionMainQuery())) + } + + Query oneDefinitionRuleViolatedQuery() { + //autogenerate `Query` type + result = + // `Query` type for `oneDefinitionRuleViolated` query + TQueryCPP(TImportMisra23PackageQuery(TOneDefinitionRuleViolatedQuery())) + } + + Query variableDeclaredInInnerScopeHidesOuterScopeQuery() { + //autogenerate `Query` type + result = + // `Query` type for `variableDeclaredInInnerScopeHidesOuterScope` query + TQueryCPP(TImportMisra23PackageQuery(TVariableDeclaredInInnerScopeHidesOuterScopeQuery())) + } + + Query derivedClasseConcealFunctionInheritedFromTheBaseQuery() { + //autogenerate `Query` type + result = + // `Query` type for `derivedClasseConcealFunctionInheritedFromTheBase` query + TQueryCPP(TImportMisra23PackageQuery(TDerivedClasseConcealFunctionInheritedFromTheBaseQuery())) + } + + Query nameInDependentBaseResolvedByUnqualifiedLookupQuery() { + //autogenerate `Query` type + result = + // `Query` type for `nameInDependentBaseResolvedByUnqualifiedLookup` query + TQueryCPP(TImportMisra23PackageQuery(TNameInDependentBaseResolvedByUnqualifiedLookupQuery())) + } + + Query objectAccessedBeforeLifetimeMisraQuery() { + //autogenerate `Query` type + result = + // `Query` type for `objectAccessedBeforeLifetimeMisra` query + TQueryCPP(TImportMisra23PackageQuery(TObjectAccessedBeforeLifetimeMisraQuery())) + } + + Query objectAccessedAfterLifetimeMisraQuery() { + //autogenerate `Query` type + result = + // `Query` type for `objectAccessedAfterLifetimeMisra` query + TQueryCPP(TImportMisra23PackageQuery(TObjectAccessedAfterLifetimeMisraQuery())) + } + + Query mustNotReturnReferenceToLocalAutomaticVariableQuery() { + //autogenerate `Query` type + result = + // `Query` type for `mustNotReturnReferenceToLocalAutomaticVariable` query + TQueryCPP(TImportMisra23PackageQuery(TMustNotReturnReferenceToLocalAutomaticVariableQuery())) + } + + Query nullptrNotTheOnlyFormOfTheNullPointerConstantQuery() { + //autogenerate `Query` type + result = + // `Query` type for `nullptrNotTheOnlyFormOfTheNullPointerConstant` query + TQueryCPP(TImportMisra23PackageQuery(TNullptrNotTheOnlyFormOfTheNullPointerConstantQuery())) + } + + Query arrayPassedAsFunctionArgumentDecayToAPointerQuery() { + //autogenerate `Query` type + result = + // `Query` type for `arrayPassedAsFunctionArgumentDecayToAPointer` query + TQueryCPP(TImportMisra23PackageQuery(TArrayPassedAsFunctionArgumentDecayToAPointerQuery())) + } + + Query resultOfAnAssignmentOperatorShouldNotBeUsedQuery() { + //autogenerate `Query` type + result = + // `Query` type for `resultOfAnAssignmentOperatorShouldNotBeUsed` query + TQueryCPP(TImportMisra23PackageQuery(TResultOfAnAssignmentOperatorShouldNotBeUsedQuery())) + } + + Query commaOperatorShouldNotBeUsedQuery() { + //autogenerate `Query` type + result = + // `Query` type for `commaOperatorShouldNotBeUsed` query + TQueryCPP(TImportMisra23PackageQuery(TCommaOperatorShouldNotBeUsedQuery())) + } + + Query functionsCallThemselvesEitherDirectlyOrIndirectlyQuery() { + //autogenerate `Query` type + result = + // `Query` type for `functionsCallThemselvesEitherDirectlyOrIndirectly` query + TQueryCPP(TImportMisra23PackageQuery(TFunctionsCallThemselvesEitherDirectlyOrIndirectlyQuery())) + } + + Query castRemovesConstOrVolatileFromPointerOrReferenceQuery() { + //autogenerate `Query` type + result = + // `Query` type for `castRemovesConstOrVolatileFromPointerOrReference` query + TQueryCPP(TImportMisra23PackageQuery(TCastRemovesConstOrVolatileFromPointerOrReferenceQuery())) + } + + Query castsBetweenAPointerToFunctionAndAnyOtherTypeQuery() { + //autogenerate `Query` type + result = + // `Query` type for `castsBetweenAPointerToFunctionAndAnyOtherType` query + TQueryCPP(TImportMisra23PackageQuery(TCastsBetweenAPointerToFunctionAndAnyOtherTypeQuery())) + } + + Query reinterpretCastShallNotBeUsedQuery() { + //autogenerate `Query` type + result = + // `Query` type for `reinterpretCastShallNotBeUsed` query + TQueryCPP(TImportMisra23PackageQuery(TReinterpretCastShallNotBeUsedQuery())) + } + + Query unsignedOperationWithConstantOperandsShouldNotWrapQuery() { + //autogenerate `Query` type + result = + // `Query` type for `unsignedOperationWithConstantOperandsShouldNotWrap` query + TQueryCPP(TImportMisra23PackageQuery(TUnsignedOperationWithConstantOperandsShouldNotWrapQuery())) + } + + Query builtInOperatorAppliedToUnsignedExpressionQuery() { + //autogenerate `Query` type + result = + // `Query` type for `builtInOperatorAppliedToUnsignedExpression` query + TQueryCPP(TImportMisra23PackageQuery(TBuiltInOperatorAppliedToUnsignedExpressionQuery())) + } + + Query bodyOfIterationOrSelectionStatementNotCompoundQuery() { + //autogenerate `Query` type + result = + // `Query` type for `bodyOfIterationOrSelectionStatementNotCompound` query + TQueryCPP(TImportMisra23PackageQuery(TBodyOfIterationOrSelectionStatementNotCompoundQuery())) + } + + Query ifElseIfEndConditionQuery() { + //autogenerate `Query` type + result = + // `Query` type for `ifElseIfEndCondition` query + TQueryCPP(TImportMisra23PackageQuery(TIfElseIfEndConditionQuery())) + } + + Query gotoStatementShouldNotBeUsedQuery() { + //autogenerate `Query` type + result = + // `Query` type for `gotoStatementShouldNotBeUsed` query + TQueryCPP(TImportMisra23PackageQuery(TGotoStatementShouldNotBeUsedQuery())) + } + + Query gotoShallReferenceALabelInSurroundingBlockQuery() { + //autogenerate `Query` type + result = + // `Query` type for `gotoShallReferenceALabelInSurroundingBlock` query + TQueryCPP(TImportMisra23PackageQuery(TGotoShallReferenceALabelInSurroundingBlockQuery())) + } + + Query gotoShallJumpToLabelDeclaredLaterInTheFunctionQuery() { + //autogenerate `Query` type + result = + // `Query` type for `gotoShallJumpToLabelDeclaredLaterInTheFunction` query + TQueryCPP(TImportMisra23PackageQuery(TGotoShallJumpToLabelDeclaredLaterInTheFunctionQuery())) + } + + Query functionDeclaredWithTheNoreturnAttributeReturnQuery() { + //autogenerate `Query` type + result = + // `Query` type for `functionDeclaredWithTheNoreturnAttributeReturn` query + TQueryCPP(TImportMisra23PackageQuery(TFunctionDeclaredWithTheNoreturnAttributeReturnQuery())) + } + + Query nonVoidFunctionShallReturnAValueOnAllPathsQuery() { + //autogenerate `Query` type + result = + // `Query` type for `nonVoidFunctionShallReturnAValueOnAllPaths` query + TQueryCPP(TImportMisra23PackageQuery(TNonVoidFunctionShallReturnAValueOnAllPathsQuery())) + } +} diff --git a/cpp/common/src/codingstandards/cpp/exclusions/cpp/RuleMetadata.qll b/cpp/common/src/codingstandards/cpp/exclusions/cpp/RuleMetadata.qll index 8dfbf9feaa..4a6cbe936b 100644 --- a/cpp/common/src/codingstandards/cpp/exclusions/cpp/RuleMetadata.qll +++ b/cpp/common/src/codingstandards/cpp/exclusions/cpp/RuleMetadata.qll @@ -21,6 +21,7 @@ import Expressions import Freed import Functions import IO +import ImportMisra23 import Includes import Inheritance import Initialization @@ -74,6 +75,7 @@ newtype TCPPQuery = TFreedPackageQuery(FreedQuery q) or TFunctionsPackageQuery(FunctionsQuery q) or TIOPackageQuery(IOQuery q) or + TImportMisra23PackageQuery(ImportMisra23Query q) or TIncludesPackageQuery(IncludesQuery q) or TInheritancePackageQuery(InheritanceQuery q) or TInitializationPackageQuery(InitializationQuery q) or @@ -127,6 +129,7 @@ predicate isQueryMetadata(Query query, string queryId, string ruleId, string cat isFreedQueryMetadata(query, queryId, ruleId, category) or isFunctionsQueryMetadata(query, queryId, ruleId, category) or isIOQueryMetadata(query, queryId, ruleId, category) or + isImportMisra23QueryMetadata(query, queryId, ruleId, category) or isIncludesQueryMetadata(query, queryId, ruleId, category) or isInheritanceQueryMetadata(query, queryId, ruleId, category) or isInitializationQueryMetadata(query, queryId, ruleId, category) or diff --git a/cpp/misra/src/rules/DIR-5-7-2/SectionsOfCodeShouldNotBeCommentedOut.ql b/cpp/misra/src/rules/DIR-5-7-2/SectionsOfCodeShouldNotBeCommentedOut.ql new file mode 100644 index 0000000000..75eb48ec67 --- /dev/null +++ b/cpp/misra/src/rules/DIR-5-7-2/SectionsOfCodeShouldNotBeCommentedOut.ql @@ -0,0 +1,23 @@ +/** + * @id cpp/misra/sections-of-code-should-not-be-commented-out + * @name DIR-5-7-2: Sections of code should not be “commented out” + * @description + * @kind problem + * @precision very-high + * @problem.severity error + * @tags external/misra/id/dir-5-7-2 + * maintainability + * readability + * correctness + * external/misra/obligation/advisory + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.sectionsofcodeshallnotbecommentedout.SectionsOfCodeShallNotBeCommentedOut + +class SectionsOfCodeShouldNotBeCommentedOutQuery extends SectionsOfCodeShallNotBeCommentedOutSharedQuery { + SectionsOfCodeShouldNotBeCommentedOutQuery() { + this = ImportMisra23Package::sectionsOfCodeShouldNotBeCommentedOutQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-11-3-2/DeclarationOfAnObjectIndirectionsLevel.ql b/cpp/misra/src/rules/RULE-11-3-2/DeclarationOfAnObjectIndirectionsLevel.ql new file mode 100644 index 0000000000..21293a632f --- /dev/null +++ b/cpp/misra/src/rules/RULE-11-3-2/DeclarationOfAnObjectIndirectionsLevel.ql @@ -0,0 +1,24 @@ +/** + * @id cpp/misra/declaration-of-an-object-indirections-level + * @name RULE-11-3-2: The declaration of an object should contain no more than two levels of pointer indirection + * @description + * @kind problem + * @precision very-high + * @problem.severity error + * @tags external/misra/id/rule-11-3-2 + * readability + * maintainability + * scope/single-translation-unit + * external/misra/enforcement/decidable + * external/misra/obligation/advisory + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.donotusemorethantwolevelsofpointerindirection.DoNotUseMoreThanTwoLevelsOfPointerIndirection + +class DeclarationOfAnObjectIndirectionsLevelQuery extends DoNotUseMoreThanTwoLevelsOfPointerIndirectionSharedQuery { + DeclarationOfAnObjectIndirectionsLevelQuery() { + this = ImportMisra23Package::declarationOfAnObjectIndirectionsLevelQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-18-3-3/HandlersReferToNonStaticMembersFromTheirClass.ql b/cpp/misra/src/rules/RULE-18-3-3/HandlersReferToNonStaticMembersFromTheirClass.ql new file mode 100644 index 0000000000..81a5038151 --- /dev/null +++ b/cpp/misra/src/rules/RULE-18-3-3/HandlersReferToNonStaticMembersFromTheirClass.ql @@ -0,0 +1,24 @@ +/** + * @id cpp/misra/handlers-refer-to-non-static-members-from-their-class + * @name RULE-18-3-3: Handlers for a function-try-block of a constructor or destructor shall not refer to non-static + * @description Handlers for a function-try-block of a constructor or destructor shall not refer to + * non-static members from their class or its bases + * @kind problem + * @precision very-high + * @problem.severity error + * @tags external/misra/id/rule-18-3-3 + * correctness + * scope/single-translation-unit + * external/misra/enforcement/decidable + * external/misra/obligation/required + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.destroyedvaluereferencedindestructorcatchblock.DestroyedValueReferencedInDestructorCatchBlock + +class HandlersReferToNonStaticMembersFromTheirClassQuery extends DestroyedValueReferencedInDestructorCatchBlockSharedQuery { + HandlersReferToNonStaticMembersFromTheirClassQuery() { + this = ImportMisra23Package::handlersReferToNonStaticMembersFromTheirClassQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-19-0-3/IncludeDirectivesPrecededByPreprocessorDirectives.ql b/cpp/misra/src/rules/RULE-19-0-3/IncludeDirectivesPrecededByPreprocessorDirectives.ql new file mode 100644 index 0000000000..e392630616 --- /dev/null +++ b/cpp/misra/src/rules/RULE-19-0-3/IncludeDirectivesPrecededByPreprocessorDirectives.ql @@ -0,0 +1,23 @@ +/** + * @id cpp/misra/include-directives-preceded-by-preprocessor-directives + * @name RULE-19-0-3: #include directives should only be preceded by preprocessor directives or comments + * @description + * @kind problem + * @precision very-high + * @problem.severity error + * @tags external/misra/id/rule-19-0-3 + * readability + * scope/single-translation-unit + * external/misra/enforcement/decidable + * external/misra/obligation/advisory + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.preprocessorincludespreceded.PreprocessorIncludesPreceded + +class IncludeDirectivesPrecededByPreprocessorDirectivesQuery extends PreprocessorIncludesPrecededSharedQuery { + IncludeDirectivesPrecededByPreprocessorDirectivesQuery() { + this = ImportMisra23Package::includeDirectivesPrecededByPreprocessorDirectivesQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-19-1-3/IdentifiersUsedInTheControllingExpressionOf.ql b/cpp/misra/src/rules/RULE-19-1-3/IdentifiersUsedInTheControllingExpressionOf.ql new file mode 100644 index 0000000000..13b604911b --- /dev/null +++ b/cpp/misra/src/rules/RULE-19-1-3/IdentifiersUsedInTheControllingExpressionOf.ql @@ -0,0 +1,25 @@ +/** + * @id cpp/misra/identifiers-used-in-the-controlling-expression-of + * @name RULE-19-1-3: All identifiers used in the controlling expression of #if or #elif preprocessing directives shall be + * @description All identifiers used in the controlling expression of #if or #elif preprocessing + * directives shall be defined prior to evaluation + * @kind problem + * @precision very-high + * @problem.severity error + * @tags external/misra/id/rule-19-1-3 + * correctness + * readability + * scope/single-translation-unit + * external/misra/enforcement/decidable + * external/misra/obligation/required + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.undefinedmacroidentifiers.UndefinedMacroIdentifiers + +class IdentifiersUsedInTheControllingExpressionOfQuery extends UndefinedMacroIdentifiersSharedQuery { + IdentifiersUsedInTheControllingExpressionOfQuery() { + this = ImportMisra23Package::identifiersUsedInTheControllingExpressionOfQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-19-2-3/CharsThatShouldNotOccurInHeaderFileName.ql b/cpp/misra/src/rules/RULE-19-2-3/CharsThatShouldNotOccurInHeaderFileName.ql new file mode 100644 index 0000000000..20a4912a28 --- /dev/null +++ b/cpp/misra/src/rules/RULE-19-2-3/CharsThatShouldNotOccurInHeaderFileName.ql @@ -0,0 +1,24 @@ +/** + * @id cpp/misra/chars-that-should-not-occur-in-header-file-name + * @name RULE-19-2-3: The ' or " or \ characters and the /* or // character sequences shall not occur in a header file + * @description The ' or " or \ characters and the /* or // character sequences shall not occur in a + * header file name + * @kind problem + * @precision very-high + * @problem.severity error + * @tags external/misra/id/rule-19-2-3 + * scope/single-translation-unit + * correctness + * external/misra/enforcement/decidable + * external/misra/obligation/required + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.preprocessorincludesforbiddenheadernames.PreprocessorIncludesForbiddenHeaderNames + +class CharsThatShouldNotOccurInHeaderFileNameQuery extends PreprocessorIncludesForbiddenHeaderNamesSharedQuery { + CharsThatShouldNotOccurInHeaderFileNameQuery() { + this = ImportMisra23Package::charsThatShouldNotOccurInHeaderFileNameQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-19-3-1/AndPreprocessorOperatorsShouldNotBeUsed.ql b/cpp/misra/src/rules/RULE-19-3-1/AndPreprocessorOperatorsShouldNotBeUsed.ql new file mode 100644 index 0000000000..9b6430475e --- /dev/null +++ b/cpp/misra/src/rules/RULE-19-3-1/AndPreprocessorOperatorsShouldNotBeUsed.ql @@ -0,0 +1,23 @@ +/** + * @id cpp/misra/and-preprocessor-operators-should-not-be-used + * @name RULE-19-3-1: The # and ## preprocessor operators should not be used + * @description + * @kind problem + * @precision very-high + * @problem.severity error + * @tags external/misra/id/rule-19-3-1 + * correctness + * scope/single-translation-unit + * external/misra/enforcement/decidable + * external/misra/obligation/advisory + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.hashoperatorsused.HashOperatorsUsed + +class AndPreprocessorOperatorsShouldNotBeUsedQuery extends HashOperatorsUsedSharedQuery { + AndPreprocessorOperatorsShouldNotBeUsedQuery() { + this = ImportMisra23Package::andPreprocessorOperatorsShouldNotBeUsedQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-19-3-5/TokensThatLookLikeDirectivesInAMacroArgument.ql b/cpp/misra/src/rules/RULE-19-3-5/TokensThatLookLikeDirectivesInAMacroArgument.ql new file mode 100644 index 0000000000..3e553d0397 --- /dev/null +++ b/cpp/misra/src/rules/RULE-19-3-5/TokensThatLookLikeDirectivesInAMacroArgument.ql @@ -0,0 +1,24 @@ +/** + * @id cpp/misra/tokens-that-look-like-directives-in-a-macro-argument + * @name RULE-19-3-5: Tokens that look like a preprocessing directive shall not occur within a macro argument + * @description + * @kind problem + * @precision very-high + * @problem.severity error + * @tags external/misra/id/rule-19-3-5 + * readability + * correctness + * scope/single-translation-unit + * external/misra/enforcement/decidable + * external/misra/obligation/required + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.preprocessingdirectivewithinmacroargument.PreprocessingDirectiveWithinMacroArgument + +class TokensThatLookLikeDirectivesInAMacroArgumentQuery extends PreprocessingDirectiveWithinMacroArgumentSharedQuery { + TokensThatLookLikeDirectivesInAMacroArgumentQuery() { + this = ImportMisra23Package::tokensThatLookLikeDirectivesInAMacroArgumentQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-21-6-5/PointerToAnIncompleteClassTypeDeleted.ql b/cpp/misra/src/rules/RULE-21-6-5/PointerToAnIncompleteClassTypeDeleted.ql new file mode 100644 index 0000000000..0d2de4deae --- /dev/null +++ b/cpp/misra/src/rules/RULE-21-6-5/PointerToAnIncompleteClassTypeDeleted.ql @@ -0,0 +1,23 @@ +/** + * @id cpp/misra/pointer-to-an-incomplete-class-type-deleted + * @name RULE-21-6-5: A pointer to an incomplete class type shall not be deleted + * @description + * @kind problem + * @precision very-high + * @problem.severity error + * @tags external/misra/id/rule-21-6-5 + * correctness + * scope/single-translation-unit + * external/misra/enforcement/decidable + * external/misra/obligation/required + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.deleteofpointertoincompleteclass.DeleteOfPointerToIncompleteClass + +class PointerToAnIncompleteClassTypeDeletedQuery extends DeleteOfPointerToIncompleteClassSharedQuery { + PointerToAnIncompleteClassTypeDeletedQuery() { + this = ImportMisra23Package::pointerToAnIncompleteClassTypeDeletedQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-25-5-2/PointersReturnedByLocaleFunctionsMustBeUsedAsConst.ql b/cpp/misra/src/rules/RULE-25-5-2/PointersReturnedByLocaleFunctionsMustBeUsedAsConst.ql new file mode 100644 index 0000000000..8fbb7d4d42 --- /dev/null +++ b/cpp/misra/src/rules/RULE-25-5-2/PointersReturnedByLocaleFunctionsMustBeUsedAsConst.ql @@ -0,0 +1,26 @@ +/** + * @id cpp/misra/pointers-returned-by-locale-functions-must-be-used-as-const + * @name RULE-25-5-2: The pointers returned by environment functions should be treated as const + * @description The pointers returned by the C++ Standard Library functions localeconv, getenv, + * setlocale or strerror must only be used as if they have pointer to const-qualified + * type + * @kind path-problem + * @precision very-high + * @problem.severity error + * @tags external/misra/id/rule-25-5-2 + * correctness + * scope/single-translation-unit + * external/misra/enforcement/decidable + * external/misra/obligation/mandatory + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.constlikereturnvalue.ConstLikeReturnValue + +class PointersReturnedByLocaleFunctionsMustBeUsedAsConstQuery extends ConstLikeReturnValueSharedQuery +{ + PointersReturnedByLocaleFunctionsMustBeUsedAsConstQuery() { + this = ImportMisra23Package::pointersReturnedByLocaleFunctionsMustBeUsedAsConstQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersMisra.ql b/cpp/misra/src/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersMisra.ql new file mode 100644 index 0000000000..58edb5e60f --- /dev/null +++ b/cpp/misra/src/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersMisra.ql @@ -0,0 +1,25 @@ +/** + * @id cpp/misra/call-to-setlocale-invalidates-old-pointers-misra + * @name RULE-25-5-3: The pointer returned by the Standard Library env functions is invalid + * @description The pointer returned by the Standard Library functions asctime, ctime, gmtime, + * localtime, localeconv, getenv, setlocale or strerror may be invalid following a + * subsequent call to the same function. + * @kind problem + * @precision very-high + * @problem.severity error + * @tags external/misra/id/rule-25-5-3 + * correctness + * scope/system + * external/misra/enforcement/undecidable + * external/misra/obligation/mandatory + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.invalidatedenvstringpointers.InvalidatedEnvStringPointers + +class CallToSetlocaleInvalidatesOldPointersMisraQuery extends InvalidatedEnvStringPointersSharedQuery { + CallToSetlocaleInvalidatesOldPointersMisraQuery() { + this = ImportMisra23Package::callToSetlocaleInvalidatesOldPointersMisraQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersWarnMisra.ql b/cpp/misra/src/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersWarnMisra.ql new file mode 100644 index 0000000000..2b4b08bd98 --- /dev/null +++ b/cpp/misra/src/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersWarnMisra.ql @@ -0,0 +1,25 @@ +/** + * @id cpp/misra/call-to-setlocale-invalidates-old-pointers-warn-misra + * @name RULE-25-5-3: The pointer returned by the Standard Library env functions is invalid warning + * @description The pointer returned by the Standard Library functions asctime, ctime, gmtime, + * localtime, localeconv, getenv, setlocale or strerror may be invalid following a + * subsequent call to the same function. + * @kind problem + * @precision very-high + * @problem.severity warning + * @tags external/misra/id/rule-25-5-3 + * correctness + * scope/system + * external/misra/enforcement/undecidable + * external/misra/obligation/mandatory + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.invalidatedenvstringpointerswarn.InvalidatedEnvStringPointersWarn + +class CallToSetlocaleInvalidatesOldPointersWarnMisraQuery extends InvalidatedEnvStringPointersWarnSharedQuery { + CallToSetlocaleInvalidatesOldPointersWarnMisraQuery() { + this = ImportMisra23Package::callToSetlocaleInvalidatesOldPointersWarnMisraQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-28-6-3/ObjectUsedWhileInPotentiallyMovedFromState.ql b/cpp/misra/src/rules/RULE-28-6-3/ObjectUsedWhileInPotentiallyMovedFromState.ql new file mode 100644 index 0000000000..416daa9c07 --- /dev/null +++ b/cpp/misra/src/rules/RULE-28-6-3/ObjectUsedWhileInPotentiallyMovedFromState.ql @@ -0,0 +1,23 @@ +/** + * @id cpp/misra/object-used-while-in-potentially-moved-from-state + * @name RULE-28-6-3: An object shall not be used while in a potentially moved-from state + * @description + * @kind problem + * @precision very-high + * @problem.severity error + * @tags external/misra/id/rule-28-6-3 + * correctness + * scope/single-translation-unit + * external/misra/enforcement/decidable + * external/misra/obligation/required + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.movedfromobjectsunspecifiedstate.MovedFromObjectsUnspecifiedState + +class ObjectUsedWhileInPotentiallyMovedFromStateQuery extends MovedFromObjectsUnspecifiedStateSharedQuery { + ObjectUsedWhileInPotentiallyMovedFromStateQuery() { + this = ImportMisra23Package::objectUsedWhileInPotentiallyMovedFromStateQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-30-0-2/ReadsAndWritesOnStreamNotSeparatedByPositioning.ql b/cpp/misra/src/rules/RULE-30-0-2/ReadsAndWritesOnStreamNotSeparatedByPositioning.ql new file mode 100644 index 0000000000..a209347915 --- /dev/null +++ b/cpp/misra/src/rules/RULE-30-0-2/ReadsAndWritesOnStreamNotSeparatedByPositioning.ql @@ -0,0 +1,23 @@ +/** + * @id cpp/misra/reads-and-writes-on-stream-not-separated-by-positioning + * @name RULE-30-0-2: Reads and writes on the same file stream shall be separated by a positioning operation + * @description + * @kind problem + * @precision very-high + * @problem.severity error + * @tags external/misra/id/rule-30-0-2 + * correctness + * scope/system + * external/misra/enforcement/undecidable + * external/misra/obligation/required + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.iofstreammissingpositioning.IOFstreamMissingPositioning + +class ReadsAndWritesOnStreamNotSeparatedByPositioningQuery extends IOFstreamMissingPositioningSharedQuery { + ReadsAndWritesOnStreamNotSeparatedByPositioningQuery() { + this = ImportMisra23Package::readsAndWritesOnStreamNotSeparatedByPositioningQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-6-2-1/OneDefinitionRuleViolated.ql b/cpp/misra/src/rules/RULE-6-2-1/OneDefinitionRuleViolated.ql new file mode 100644 index 0000000000..b682c354a5 --- /dev/null +++ b/cpp/misra/src/rules/RULE-6-2-1/OneDefinitionRuleViolated.ql @@ -0,0 +1,23 @@ +/** + * @id cpp/misra/one-definition-rule-violated + * @name RULE-6-2-1: The one-definition rule shall not be violated + * @description + * @kind problem + * @precision very-high + * @problem.severity error + * @tags external/misra/id/rule-6-2-1 + * correctness + * scope/system + * external/misra/enforcement/decidable + * external/misra/obligation/required + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.onedefinitionruleviolation.OneDefinitionRuleViolation + +class OneDefinitionRuleViolatedQuery extends OneDefinitionRuleViolationSharedQuery { + OneDefinitionRuleViolatedQuery() { + this = ImportMisra23Package::oneDefinitionRuleViolatedQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-6-4-1/VariableDeclaredInInnerScopeHidesOuterScope.ql b/cpp/misra/src/rules/RULE-6-4-1/VariableDeclaredInInnerScopeHidesOuterScope.ql new file mode 100644 index 0000000000..1813ebc77a --- /dev/null +++ b/cpp/misra/src/rules/RULE-6-4-1/VariableDeclaredInInnerScopeHidesOuterScope.ql @@ -0,0 +1,24 @@ +/** + * @id cpp/misra/variable-declared-in-inner-scope-hides-outer-scope + * @name RULE-6-4-1: A variable declared in an inner scope shall not hide a variable declared in an outer scope + * @description + * @kind problem + * @precision very-high + * @problem.severity error + * @tags external/misra/id/rule-6-4-1 + * readability + * maintainability + * scope/single-translation-unit + * external/misra/enforcement/decidable + * external/misra/obligation/required + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.identifierhidden.IdentifierHidden + +class VariableDeclaredInInnerScopeHidesOuterScopeQuery extends IdentifierHiddenSharedQuery { + VariableDeclaredInInnerScopeHidesOuterScopeQuery() { + this = ImportMisra23Package::variableDeclaredInInnerScopeHidesOuterScopeQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-6-8-1/ObjectAccessedAfterLifetimeMisra.ql b/cpp/misra/src/rules/RULE-6-8-1/ObjectAccessedAfterLifetimeMisra.ql new file mode 100644 index 0000000000..77483fdedb --- /dev/null +++ b/cpp/misra/src/rules/RULE-6-8-1/ObjectAccessedAfterLifetimeMisra.ql @@ -0,0 +1,23 @@ +/** + * @id cpp/misra/object-accessed-after-lifetime-misra + * @name RULE-6-8-1: Access of object after lifetime (use-after-free) + * @description Accessing an object after its lifetime results in undefined behavior. + * @kind problem + * @precision high + * @problem.severity error + * @tags external/misra/id/rule-6-8-1 + * correctness + * security + * external/misra/enforcement/undecidable + * external/misra/obligation/required + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.objectaccessedafterlifetime.ObjectAccessedAfterLifetime + +class ObjectAccessedAfterLifetimeMisraQuery extends ObjectAccessedAfterLifetimeSharedQuery { + ObjectAccessedAfterLifetimeMisraQuery() { + this = ImportMisra23Package::objectAccessedAfterLifetimeMisraQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-6-8-1/ObjectAccessedBeforeLifetimeMisra.ql b/cpp/misra/src/rules/RULE-6-8-1/ObjectAccessedBeforeLifetimeMisra.ql new file mode 100644 index 0000000000..e0e82f2396 --- /dev/null +++ b/cpp/misra/src/rules/RULE-6-8-1/ObjectAccessedBeforeLifetimeMisra.ql @@ -0,0 +1,23 @@ +/** + * @id cpp/misra/object-accessed-before-lifetime-misra + * @name RULE-6-8-1: Access of uninitialized object + * @description Accessing an object before its lifetime can result in undefined behavior. + * @kind problem + * @precision high + * @problem.severity error + * @tags external/misra/id/rule-6-8-1 + * correctness + * security + * external/misra/enforcement/undecidable + * external/misra/obligation/required + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.objectaccessedbeforelifetime.ObjectAccessedBeforeLifetime + +class ObjectAccessedBeforeLifetimeMisraQuery extends ObjectAccessedBeforeLifetimeSharedQuery { + ObjectAccessedBeforeLifetimeMisraQuery() { + this = ImportMisra23Package::objectAccessedBeforeLifetimeMisraQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-8-2-3/CastRemovesConstOrVolatileFromPointerOrReference.ql b/cpp/misra/src/rules/RULE-8-2-3/CastRemovesConstOrVolatileFromPointerOrReference.ql new file mode 100644 index 0000000000..0c2e56b5bd --- /dev/null +++ b/cpp/misra/src/rules/RULE-8-2-3/CastRemovesConstOrVolatileFromPointerOrReference.ql @@ -0,0 +1,24 @@ +/** + * @id cpp/misra/cast-removes-const-or-volatile-from-pointer-or-reference + * @name RULE-8-2-3: A cast shall not remove any const or volatile qualification from the type accessed via a pointer or + * @description A cast shall not remove any const or volatile qualification from the type accessed + * via a pointer or by reference + * @kind problem + * @precision very-high + * @problem.severity error + * @tags external/misra/id/rule-8-2-3 + * correctness + * scope/single-translation-unit + * external/misra/enforcement/decidable + * external/misra/obligation/required + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.removeconstorvolatilequalification.RemoveConstOrVolatileQualification + +class CastRemovesConstOrVolatileFromPointerOrReferenceQuery extends RemoveConstOrVolatileQualificationSharedQuery { + CastRemovesConstOrVolatileFromPointerOrReferenceQuery() { + this = ImportMisra23Package::castRemovesConstOrVolatileFromPointerOrReferenceQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-9-4-1/IfElseIfEndCondition.ql b/cpp/misra/src/rules/RULE-9-4-1/IfElseIfEndCondition.ql new file mode 100644 index 0000000000..2345e3f25f --- /dev/null +++ b/cpp/misra/src/rules/RULE-9-4-1/IfElseIfEndCondition.ql @@ -0,0 +1,24 @@ +/** + * @id cpp/misra/if-else-if-end-condition + * @name RULE-9-4-1: All if + * @description All if ... else if constructs shall be terminated with an else statement + * @kind problem + * @precision very-high + * @problem.severity error + * @tags external/misra/id/rule-9-4-1 + * readability + * maintainability + * scope/single-translation-unit + * external/misra/enforcement/decidable + * external/misra/obligation/required + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.ifelseterminationconstruct.IfElseTerminationConstruct + +class IfElseIfEndConditionQuery extends IfElseTerminationConstructSharedQuery { + IfElseIfEndConditionQuery() { + this = ImportMisra23Package::ifElseIfEndConditionQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-9-6-3/GotoShallJumpToLabelDeclaredLaterInTheFunction.ql b/cpp/misra/src/rules/RULE-9-6-3/GotoShallJumpToLabelDeclaredLaterInTheFunction.ql new file mode 100644 index 0000000000..c0e5e0fe83 --- /dev/null +++ b/cpp/misra/src/rules/RULE-9-6-3/GotoShallJumpToLabelDeclaredLaterInTheFunction.ql @@ -0,0 +1,24 @@ +/** + * @id cpp/misra/goto-shall-jump-to-label-declared-later-in-the-function + * @name RULE-9-6-3: The goto statement shall jump to a label declared later in the function body + * @description + * @kind problem + * @precision very-high + * @problem.severity error + * @tags external/misra/id/rule-9-6-3 + * maintainability + * readability + * scope/single-translation-unit + * external/misra/enforcement/decidable + * external/misra/obligation/required + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.gotostatementcondition.GotoStatementCondition + +class GotoShallJumpToLabelDeclaredLaterInTheFunctionQuery extends GotoStatementConditionSharedQuery { + GotoShallJumpToLabelDeclaredLaterInTheFunctionQuery() { + this = ImportMisra23Package::gotoShallJumpToLabelDeclaredLaterInTheFunctionQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-9-6-4/FunctionDeclaredWithTheNoreturnAttributeReturn.ql b/cpp/misra/src/rules/RULE-9-6-4/FunctionDeclaredWithTheNoreturnAttributeReturn.ql new file mode 100644 index 0000000000..23221348c0 --- /dev/null +++ b/cpp/misra/src/rules/RULE-9-6-4/FunctionDeclaredWithTheNoreturnAttributeReturn.ql @@ -0,0 +1,23 @@ +/** + * @id cpp/misra/function-declared-with-the-noreturn-attribute-return + * @name RULE-9-6-4: A function declared with the [[noreturn]] attribute shall not return + * @description + * @kind problem + * @precision very-high + * @problem.severity error + * @tags external/misra/id/rule-9-6-4 + * correctness + * scope/system + * external/misra/enforcement/undecidable + * external/misra/obligation/required + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.functionnoreturnattributecondition.FunctionNoReturnAttributeCondition + +class FunctionDeclaredWithTheNoreturnAttributeReturnQuery extends FunctionNoReturnAttributeConditionSharedQuery { + FunctionDeclaredWithTheNoreturnAttributeReturnQuery() { + this = ImportMisra23Package::functionDeclaredWithTheNoreturnAttributeReturnQuery() + } +} diff --git a/cpp/misra/src/rules/RULE-9-6-5/NonVoidFunctionShallReturnAValueOnAllPaths.ql b/cpp/misra/src/rules/RULE-9-6-5/NonVoidFunctionShallReturnAValueOnAllPaths.ql new file mode 100644 index 0000000000..74802bcee9 --- /dev/null +++ b/cpp/misra/src/rules/RULE-9-6-5/NonVoidFunctionShallReturnAValueOnAllPaths.ql @@ -0,0 +1,23 @@ +/** + * @id cpp/misra/non-void-function-shall-return-a-value-on-all-paths + * @name RULE-9-6-5: A function with non-void return type shall return a value on all paths + * @description + * @kind problem + * @precision very-high + * @problem.severity error + * @tags external/misra/id/rule-9-6-5 + * correctness + * scope/single-translation-unit + * external/misra/enforcement/decidable + * external/misra/obligation/required + */ + +import cpp +import codingstandards.cpp.misra +import codingstandards.cpp.rules.nonvoidfunctiondoesnotreturn.NonVoidFunctionDoesNotReturn + +class NonVoidFunctionShallReturnAValueOnAllPathsQuery extends NonVoidFunctionDoesNotReturnSharedQuery { + NonVoidFunctionShallReturnAValueOnAllPathsQuery() { + this = ImportMisra23Package::nonVoidFunctionShallReturnAValueOnAllPathsQuery() + } +} diff --git a/cpp/misra/test/rules/DIR-5-7-2/SectionsOfCodeShouldNotBeCommentedOut.testref b/cpp/misra/test/rules/DIR-5-7-2/SectionsOfCodeShouldNotBeCommentedOut.testref new file mode 100644 index 0000000000..303a38a19b --- /dev/null +++ b/cpp/misra/test/rules/DIR-5-7-2/SectionsOfCodeShouldNotBeCommentedOut.testref @@ -0,0 +1 @@ +cpp/common/test/rules/sectionsofcodeshallnotbecommentedout/SectionsOfCodeShallNotBeCommentedOut.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-11-3-2/DeclarationOfAnObjectIndirectionsLevel.testref b/cpp/misra/test/rules/RULE-11-3-2/DeclarationOfAnObjectIndirectionsLevel.testref new file mode 100644 index 0000000000..3b46dca736 --- /dev/null +++ b/cpp/misra/test/rules/RULE-11-3-2/DeclarationOfAnObjectIndirectionsLevel.testref @@ -0,0 +1 @@ +cpp/common/test/rules/donotusemorethantwolevelsofpointerindirection/DoNotUseMoreThanTwoLevelsOfPointerIndirection.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-18-3-3/HandlersReferToNonStaticMembersFromTheirClass.testref b/cpp/misra/test/rules/RULE-18-3-3/HandlersReferToNonStaticMembersFromTheirClass.testref new file mode 100644 index 0000000000..7d4f5826b0 --- /dev/null +++ b/cpp/misra/test/rules/RULE-18-3-3/HandlersReferToNonStaticMembersFromTheirClass.testref @@ -0,0 +1 @@ +cpp/common/test/rules/destroyedvaluereferencedindestructorcatchblock/DestroyedValueReferencedInDestructorCatchBlock.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-19-0-3/IncludeDirectivesPrecededByPreprocessorDirectives.testref b/cpp/misra/test/rules/RULE-19-0-3/IncludeDirectivesPrecededByPreprocessorDirectives.testref new file mode 100644 index 0000000000..7992898cfc --- /dev/null +++ b/cpp/misra/test/rules/RULE-19-0-3/IncludeDirectivesPrecededByPreprocessorDirectives.testref @@ -0,0 +1 @@ +cpp/common/test/rules/preprocessorincludespreceded/PreprocessorIncludesPreceded.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-19-1-3/IdentifiersUsedInTheControllingExpressionOf.testref b/cpp/misra/test/rules/RULE-19-1-3/IdentifiersUsedInTheControllingExpressionOf.testref new file mode 100644 index 0000000000..73eb246867 --- /dev/null +++ b/cpp/misra/test/rules/RULE-19-1-3/IdentifiersUsedInTheControllingExpressionOf.testref @@ -0,0 +1 @@ +cpp/common/test/rules/undefinedmacroidentifiers/UndefinedMacroIdentifiers.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-19-2-3/CharsThatShouldNotOccurInHeaderFileName.testref b/cpp/misra/test/rules/RULE-19-2-3/CharsThatShouldNotOccurInHeaderFileName.testref new file mode 100644 index 0000000000..6be2f4f7ba --- /dev/null +++ b/cpp/misra/test/rules/RULE-19-2-3/CharsThatShouldNotOccurInHeaderFileName.testref @@ -0,0 +1 @@ +cpp/common/test/rules/preprocessorincludesforbiddenheadernames/PreprocessorIncludesForbiddenHeaderNames.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-19-3-1/AndPreprocessorOperatorsShouldNotBeUsed.testref b/cpp/misra/test/rules/RULE-19-3-1/AndPreprocessorOperatorsShouldNotBeUsed.testref new file mode 100644 index 0000000000..eec0b94b11 --- /dev/null +++ b/cpp/misra/test/rules/RULE-19-3-1/AndPreprocessorOperatorsShouldNotBeUsed.testref @@ -0,0 +1 @@ +cpp/common/test/rules/hashoperatorsused/HashOperatorsUsed.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-19-3-5/TokensThatLookLikeDirectivesInAMacroArgument.testref b/cpp/misra/test/rules/RULE-19-3-5/TokensThatLookLikeDirectivesInAMacroArgument.testref new file mode 100644 index 0000000000..1e15c636ee --- /dev/null +++ b/cpp/misra/test/rules/RULE-19-3-5/TokensThatLookLikeDirectivesInAMacroArgument.testref @@ -0,0 +1 @@ +cpp/common/test/rules/preprocessingdirectivewithinmacroargument/PreprocessingDirectiveWithinMacroArgument.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-21-6-5/PointerToAnIncompleteClassTypeDeleted.testref b/cpp/misra/test/rules/RULE-21-6-5/PointerToAnIncompleteClassTypeDeleted.testref new file mode 100644 index 0000000000..3f4895b1c4 --- /dev/null +++ b/cpp/misra/test/rules/RULE-21-6-5/PointerToAnIncompleteClassTypeDeleted.testref @@ -0,0 +1 @@ +cpp/common/test/rules/deleteofpointertoincompleteclass/DeleteOfPointerToIncompleteClass.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-25-5-2/PointersReturnedByLocaleFunctionsMustBeUsedAsConst.testref b/cpp/misra/test/rules/RULE-25-5-2/PointersReturnedByLocaleFunctionsMustBeUsedAsConst.testref new file mode 100644 index 0000000000..febf2e9d50 --- /dev/null +++ b/cpp/misra/test/rules/RULE-25-5-2/PointersReturnedByLocaleFunctionsMustBeUsedAsConst.testref @@ -0,0 +1 @@ +cpp/common/test/rules/constlikereturnvalue/ConstLikeReturnValue.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersMisra.testref b/cpp/misra/test/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersMisra.testref new file mode 100644 index 0000000000..74cb92bd88 --- /dev/null +++ b/cpp/misra/test/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersMisra.testref @@ -0,0 +1 @@ +cpp/common/test/rules/invalidatedenvstringpointers/InvalidatedEnvStringPointers.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersWarnMisra.testref b/cpp/misra/test/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersWarnMisra.testref new file mode 100644 index 0000000000..1628a12aa9 --- /dev/null +++ b/cpp/misra/test/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersWarnMisra.testref @@ -0,0 +1 @@ +cpp/common/test/rules/invalidatedenvstringpointerswarn/InvalidatedEnvStringPointersWarn.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-28-6-3/ObjectUsedWhileInPotentiallyMovedFromState.testref b/cpp/misra/test/rules/RULE-28-6-3/ObjectUsedWhileInPotentiallyMovedFromState.testref new file mode 100644 index 0000000000..5ae8b65a71 --- /dev/null +++ b/cpp/misra/test/rules/RULE-28-6-3/ObjectUsedWhileInPotentiallyMovedFromState.testref @@ -0,0 +1 @@ +cpp/common/test/rules/movedfromobjectsunspecifiedstate/MovedFromObjectsUnspecifiedState.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-30-0-2/ReadsAndWritesOnStreamNotSeparatedByPositioning.testref b/cpp/misra/test/rules/RULE-30-0-2/ReadsAndWritesOnStreamNotSeparatedByPositioning.testref new file mode 100644 index 0000000000..0a8adf7272 --- /dev/null +++ b/cpp/misra/test/rules/RULE-30-0-2/ReadsAndWritesOnStreamNotSeparatedByPositioning.testref @@ -0,0 +1 @@ +cpp/common/test/rules/iofstreammissingpositioning/IOFstreamMissingPositioning.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-6-2-1/OneDefinitionRuleViolated.testref b/cpp/misra/test/rules/RULE-6-2-1/OneDefinitionRuleViolated.testref new file mode 100644 index 0000000000..b51950abaa --- /dev/null +++ b/cpp/misra/test/rules/RULE-6-2-1/OneDefinitionRuleViolated.testref @@ -0,0 +1 @@ +cpp/common/test/rules/onedefinitionruleviolation/OneDefinitionRuleViolation.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-6-4-1/VariableDeclaredInInnerScopeHidesOuterScope.testref b/cpp/misra/test/rules/RULE-6-4-1/VariableDeclaredInInnerScopeHidesOuterScope.testref new file mode 100644 index 0000000000..2f41afee3b --- /dev/null +++ b/cpp/misra/test/rules/RULE-6-4-1/VariableDeclaredInInnerScopeHidesOuterScope.testref @@ -0,0 +1 @@ +cpp/common/test/rules/identifierhidden/IdentifierHidden.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-6-8-1/ObjectAccessedAfterLifetimeMisra.testref b/cpp/misra/test/rules/RULE-6-8-1/ObjectAccessedAfterLifetimeMisra.testref new file mode 100644 index 0000000000..979e12ac8c --- /dev/null +++ b/cpp/misra/test/rules/RULE-6-8-1/ObjectAccessedAfterLifetimeMisra.testref @@ -0,0 +1 @@ +cpp/common/test/rules/objectaccessedafterlifetime/ObjectAccessedAfterLifetime.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-6-8-1/ObjectAccessedBeforeLifetimeMisra.testref b/cpp/misra/test/rules/RULE-6-8-1/ObjectAccessedBeforeLifetimeMisra.testref new file mode 100644 index 0000000000..3f22c45632 --- /dev/null +++ b/cpp/misra/test/rules/RULE-6-8-1/ObjectAccessedBeforeLifetimeMisra.testref @@ -0,0 +1 @@ +cpp/common/test/rules/objectaccessedbeforelifetime/ObjectAccessedBeforeLifetime.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-8-2-3/CastRemovesConstOrVolatileFromPointerOrReference.testref b/cpp/misra/test/rules/RULE-8-2-3/CastRemovesConstOrVolatileFromPointerOrReference.testref new file mode 100644 index 0000000000..000469493a --- /dev/null +++ b/cpp/misra/test/rules/RULE-8-2-3/CastRemovesConstOrVolatileFromPointerOrReference.testref @@ -0,0 +1 @@ +cpp/common/test/rules/removeconstorvolatilequalification/RemoveConstOrVolatileQualification.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-9-4-1/IfElseIfEndCondition.testref b/cpp/misra/test/rules/RULE-9-4-1/IfElseIfEndCondition.testref new file mode 100644 index 0000000000..d7ca04a26e --- /dev/null +++ b/cpp/misra/test/rules/RULE-9-4-1/IfElseIfEndCondition.testref @@ -0,0 +1 @@ +cpp/common/test/rules/ifelseterminationconstruct/IfElseTerminationConstruct.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-9-6-3/GotoShallJumpToLabelDeclaredLaterInTheFunction.testref b/cpp/misra/test/rules/RULE-9-6-3/GotoShallJumpToLabelDeclaredLaterInTheFunction.testref new file mode 100644 index 0000000000..b4f807e8e2 --- /dev/null +++ b/cpp/misra/test/rules/RULE-9-6-3/GotoShallJumpToLabelDeclaredLaterInTheFunction.testref @@ -0,0 +1 @@ +cpp/common/test/rules/gotostatementcondition/GotoStatementCondition.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-9-6-4/FunctionDeclaredWithTheNoreturnAttributeReturn.testref b/cpp/misra/test/rules/RULE-9-6-4/FunctionDeclaredWithTheNoreturnAttributeReturn.testref new file mode 100644 index 0000000000..dec8006f15 --- /dev/null +++ b/cpp/misra/test/rules/RULE-9-6-4/FunctionDeclaredWithTheNoreturnAttributeReturn.testref @@ -0,0 +1 @@ +cpp/common/test/rules/functionnoreturnattributecondition/FunctionNoReturnAttributeCondition.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-9-6-5/NonVoidFunctionShallReturnAValueOnAllPaths.testref b/cpp/misra/test/rules/RULE-9-6-5/NonVoidFunctionShallReturnAValueOnAllPaths.testref new file mode 100644 index 0000000000..ef9b3c1fc2 --- /dev/null +++ b/cpp/misra/test/rules/RULE-9-6-5/NonVoidFunctionShallReturnAValueOnAllPaths.testref @@ -0,0 +1 @@ +cpp/common/test/rules/nonvoidfunctiondoesnotreturn/NonVoidFunctionDoesNotReturn.ql \ No newline at end of file diff --git a/rule_packages/cpp/ImportMisra23.json b/rule_packages/cpp/ImportMisra23.json new file mode 100644 index 0000000000..259e3f8a17 --- /dev/null +++ b/rule_packages/cpp/ImportMisra23.json @@ -0,0 +1,505 @@ +{ + "MISRA-C++-2023": { + "DIR-5-7-2": { + "properties": { + "obligation": "advisory" + }, + "queries": [ + { + "description": "", + "kind": "problem", + "name": "Sections of code should not be \u201ccommented out\u201d", + "precision": "very-high", + "severity": "error", + "short_name": "SectionsOfCodeShouldNotBeCommentedOut", + "shared_implementation_short_name": "SectionsOfCodeShallNotBeCommentedOut", + "tags": [ + "maintainability", + "readability", + "correctness" + ] + } + ], + "title": "Sections of code should not be \u201ccommented out\u201d" + }, + "RULE-6-2-1": { + "properties": { + "enforcement": "decidable", + "obligation": "required" + }, + "queries": [ + { + "description": "", + "kind": "problem", + "name": "The one-definition rule shall not be violated", + "precision": "very-high", + "severity": "error", + "short_name": "OneDefinitionRuleViolated", + "shared_implementation_short_name": "OneDefinitionRuleViolation", + "tags": [ + "correctness", + "scope/system" + ] + } + ], + "title": "The one-definition rule shall not be violated" + }, + "RULE-6-4-1": { + "properties": { + "enforcement": "decidable", + "obligation": "required" + }, + "queries": [ + { + "description": "", + "kind": "problem", + "name": "A variable declared in an inner scope shall not hide a variable declared in an outer scope", + "precision": "very-high", + "severity": "error", + "short_name": "VariableDeclaredInInnerScopeHidesOuterScope", + "shared_implementation_short_name": "IdentifierHidden", + "tags": [ + "readability", + "maintainability", + "scope/single-translation-unit" + ] + } + ], + "title": "A variable declared in an inner scope shall not hide a variable declared in an outer scope" + }, + "RULE-6-8-1": { + "properties": { + "enforcement": "undecidable", + "obligation": "required" + }, + "queries": [ + { + "description": "Accessing an object before its lifetime can result in undefined behavior.", + "kind": "problem", + "name": "Access of uninitialized object", + "precision": "high", + "severity": "error", + "shared_implementation_short_name": "ObjectAccessedBeforeLifetime", + "short_name": "ObjectAccessedBeforeLifetimeMisra", + "tags": [ + "correctness", + "security" + ] + }, + { + "description": "Accessing an object after its lifetime results in undefined behavior.", + "kind": "problem", + "name": "Access of object after lifetime (use-after-free)", + "precision": "high", + "severity": "error", + "shared_implementation_short_name": "ObjectAccessedAfterLifetime", + "short_name": "ObjectAccessedAfterLifetimeMisra", + "tags": [ + "correctness", + "security" + ] + } + ], + "title": "An object shall not be accessed outside of its lifetime" + }, + "RULE-8-2-3": { + "properties": { + "enforcement": "decidable", + "obligation": "required" + }, + "queries": [ + { + "description": "A cast shall not remove any const or volatile qualification from the type accessed via a pointer or by reference", + "kind": "problem", + "name": "A cast shall not remove any const or volatile qualification from the type accessed via a pointer or", + "precision": "very-high", + "severity": "error", + "short_name": "CastRemovesConstOrVolatileFromPointerOrReference", + "shared_implementation_short_name": "RemoveConstOrVolatileQualification", + "tags": [ + "correctness", + "scope/single-translation-unit" + ] + } + ], + "title": "A cast shall not remove any const or volatile qualification from the type accessed via a pointer or by reference" + }, + "RULE-9-4-1": { + "properties": { + "enforcement": "decidable", + "obligation": "required" + }, + "queries": [ + { + "description": "All if ... else if constructs shall be terminated with an else statement", + "kind": "problem", + "name": "All if ", + "precision": "very-high", + "severity": "error", + "short_name": "IfElseIfEndCondition", + "shared_implementation_short_name": "IfElseTerminationConstruct", + "tags": [ + "readability", + "maintainability", + "scope/single-translation-unit" + ] + } + ], + "title": "All if ... else if constructs shall be terminated with an else statement" + }, + "RULE-9-6-3": { + "properties": { + "enforcement": "decidable", + "obligation": "required" + }, + "queries": [ + { + "description": "", + "kind": "problem", + "name": "The goto statement shall jump to a label declared later in the function body", + "precision": "very-high", + "severity": "error", + "short_name": "GotoShallJumpToLabelDeclaredLaterInTheFunction", + "shared_implementation_short_name": "GotoStatementCondition", + "tags": [ + "maintainability", + "readability", + "scope/single-translation-unit" + ] + } + ], + "title": "The goto statement shall jump to a label declared later in the function body" + }, + "RULE-9-6-4": { + "properties": { + "enforcement": "undecidable", + "obligation": "required" + }, + "queries": [ + { + "description": "", + "kind": "problem", + "name": "A function declared with the [[noreturn]] attribute shall not return", + "precision": "very-high", + "severity": "error", + "short_name": "FunctionDeclaredWithTheNoreturnAttributeReturn", + "shared_implementation_short_name": "FunctionNoReturnAttributeCondition", + "tags": [ + "correctness", + "scope/system" + ] + } + ], + "title": "A function declared with the [[noreturn]] attribute shall not return" + }, + "RULE-9-6-5": { + "properties": { + "enforcement": "decidable", + "obligation": "required" + }, + "queries": [ + { + "description": "", + "kind": "problem", + "name": "A function with non-void return type shall return a value on all paths", + "precision": "very-high", + "severity": "error", + "short_name": "NonVoidFunctionShallReturnAValueOnAllPaths", + "shared_implementation_short_name": "NonVoidFunctionDoesNotReturn", + "tags": [ + "correctness", + "scope/single-translation-unit" + ] + } + ], + "title": "A function with non-void return type shall return a value on all paths" + }, + "RULE-11-3-2": { + "properties": { + "enforcement": "decidable", + "obligation": "advisory" + }, + "queries": [ + { + "description": "", + "kind": "problem", + "name": "The declaration of an object should contain no more than two levels of pointer indirection", + "precision": "very-high", + "severity": "error", + "short_name": "DeclarationOfAnObjectIndirectionsLevel", + "shared_implementation_short_name": "DoNotUseMoreThanTwoLevelsOfPointerIndirection", + "tags": [ + "readability", + "maintainability", + "scope/single-translation-unit" + ] + } + ], + "title": "The declaration of an object should contain no more than two levels of pointer indirection" + }, + "RULE-18-3-3": { + "properties": { + "enforcement": "decidable", + "obligation": "required" + }, + "queries": [ + { + "description": "Handlers for a function-try-block of a constructor or destructor shall not refer to non-static members from their class or its bases", + "kind": "problem", + "name": "Handlers for a function-try-block of a constructor or destructor shall not refer to non-static", + "precision": "very-high", + "severity": "error", + "short_name": "HandlersReferToNonStaticMembersFromTheirClass", + "shared_implementation_short_name": "DestroyedValueReferencedInDestructorCatchBlock", + "tags": [ + "correctness", + "scope/single-translation-unit" + ] + } + ], + "title": "Handlers for a function-try-block of a constructor or destructor shall not refer to non-static members from their class or its bases" + }, + "RULE-19-0-3": { + "properties": { + "enforcement": "decidable", + "obligation": "advisory" + }, + "queries": [ + { + "description": "", + "kind": "problem", + "name": "#include directives should only be preceded by preprocessor directives or comments", + "precision": "very-high", + "severity": "error", + "short_name": "IncludeDirectivesPrecededByPreprocessorDirectives", + "shared_implementation_short_name": "PreprocessorIncludesPreceded", + "tags": [ + "readability", + "scope/single-translation-unit" + ] + } + ], + "title": "#include directives should only be preceded by preprocessor directives or comments" + }, + "RULE-19-1-3": { + "properties": { + "enforcement": "decidable", + "obligation": "required" + }, + "queries": [ + { + "description": "All identifiers used in the controlling expression of #if or #elif preprocessing directives shall be defined prior to evaluation", + "kind": "problem", + "name": "All identifiers used in the controlling expression of #if or #elif preprocessing directives shall be", + "precision": "very-high", + "severity": "error", + "short_name": "IdentifiersUsedInTheControllingExpressionOf", + "shared_implementation_short_name": "UndefinedMacroIdentifiers", + "tags": [ + "correctness", + "readability", + "scope/single-translation-unit" + ] + } + ], + "title": "All identifiers used in the controlling expression of #if or #elif preprocessing directives shall be defined prior to evaluation" + }, + "RULE-19-2-3": { + "properties": { + "enforcement": "decidable", + "obligation": "required" + }, + "queries": [ + { + "description": "The ' or \" or \\ characters and the /* or // character sequences shall not occur in a header file name", + "kind": "problem", + "name": "The ' or \" or \\ characters and the /* or // character sequences shall not occur in a header file", + "precision": "very-high", + "severity": "error", + "short_name": "CharsThatShouldNotOccurInHeaderFileName", + "shared_implementation_short_name": "PreprocessorIncludesForbiddenHeaderNames", + "tags": [ + "scope/single-translation-unit", + "correctness" + ], + "implementation_scope": { + "description": "This query identifies the use of the ', \\, /*, // characters in header file names. The query is not able to detect the use of the \" character in header file names.", + "items": [] + } + } + ], + "title": "The ' or \" or \\ characters and the /* or // character sequences shall not occur in a header file name" + }, + "RULE-19-3-1": { + "properties": { + "enforcement": "decidable", + "obligation": "advisory" + }, + "queries": [ + { + "description": "", + "kind": "problem", + "name": "The # and ## preprocessor operators should not be used", + "precision": "very-high", + "severity": "error", + "short_name": "AndPreprocessorOperatorsShouldNotBeUsed", + "shared_implementation_short_name": "HashOperatorsUsed", + "tags": [ + "correctness", + "scope/single-translation-unit" + ] + } + ], + "title": "The # and ## preprocessor operators should not be used" + }, + "RULE-19-3-5": { + "properties": { + "enforcement": "decidable", + "obligation": "required" + }, + "queries": [ + { + "description": "", + "kind": "problem", + "name": "Tokens that look like a preprocessing directive shall not occur within a macro argument", + "precision": "very-high", + "severity": "error", + "short_name": "TokensThatLookLikeDirectivesInAMacroArgument", + "shared_implementation_short_name": "PreprocessingDirectiveWithinMacroArgument", + "tags": [ + "readability", + "correctness", + "scope/single-translation-unit" + ] + } + ], + "title": "Tokens that look like a preprocessing directive shall not occur within a macro argument" + }, + "RULE-21-6-5": { + "properties": { + "enforcement": "decidable", + "obligation": "required" + }, + "queries": [ + { + "description": "", + "kind": "problem", + "name": "A pointer to an incomplete class type shall not be deleted", + "precision": "very-high", + "severity": "error", + "short_name": "PointerToAnIncompleteClassTypeDeleted", + "shared_implementation_short_name": "DeleteOfPointerToIncompleteClass", + "tags": [ + "correctness", + "scope/single-translation-unit" + ] + } + ], + "title": "A pointer to an incomplete class type shall not be deleted" + }, + "RULE-25-5-2": { + "properties": { + "enforcement": "decidable", + "obligation": "mandatory" + }, + "queries": [ + { + "description": "The pointers returned by the C++ Standard Library functions localeconv, getenv, setlocale or strerror must only be used as if they have pointer to const-qualified type", + "kind": "problem", + "name": "The pointers returned by environment functions should be treated as const", + "precision": "very-high", + "severity": "error", + "short_name": "PointersReturnedByLocaleFunctionsMustBeUsedAsConst", + "shared_implementation_short_name": "ConstLikeReturnValue", + "tags": [ + "correctness", + "scope/single-translation-unit" + ] + } + ], + "title": "The pointers returned by the C++ Standard Library functions localeconv, getenv, setlocale or strerror must only be used as if they have pointer to const-qualified type" + }, + "RULE-25-5-3": { + "properties": { + "enforcement": "undecidable", + "obligation": "mandatory" + }, + "queries": [ + { + "description": "The pointer returned by the Standard Library functions asctime, ctime, gmtime, localtime, localeconv, getenv, setlocale or strerror may be invalid following a subsequent call to the same function.", + "kind": "problem", + "name": "The pointer returned by the Standard Library env functions is invalid", + "precision": "very-high", + "severity": "error", + "short_name": "CallToSetlocaleInvalidatesOldPointersMisra", + "shared_implementation_short_name": "InvalidatedEnvStringPointers", + "tags": [ + "correctness", + "scope/system" + ] + }, + { + "description": "The pointer returned by the Standard Library functions asctime, ctime, gmtime, localtime, localeconv, getenv, setlocale or strerror may be invalid following a subsequent call to the same function.", + "kind": "problem", + "name": "The pointer returned by the Standard Library env functions is invalid warning", + "precision": "very-high", + "severity": "warning", + "short_name": "CallToSetlocaleInvalidatesOldPointersWarnMisra", + "shared_implementation_short_name": "InvalidatedEnvStringPointersWarn", + "tags": [ + "correctness", + "scope/system" + ] + } + ], + "title": "The pointer returned by the C++ Standard Library functions asctime, ctime, gmtime, localtime, localeconv, getenv, setlocale or strerror must not be used following a subsequent call to the same function" + }, + "RULE-28-6-3": { + "properties": { + "enforcement": "decidable", + "obligation": "required" + }, + "queries": [ + { + "description": "", + "kind": "problem", + "name": "An object shall not be used while in a potentially moved-from state", + "precision": "very-high", + "severity": "error", + "short_name": "ObjectUsedWhileInPotentiallyMovedFromState", + "shared_implementation_short_name": "MovedFromObjectsUnspecifiedState", + "tags": [ + "correctness", + "scope/single-translation-unit" + ] + } + ], + "title": "An object shall not be used while in a potentially moved-from state" + }, + "RULE-30-0-2": { + "properties": { + "enforcement": "undecidable", + "obligation": "required" + }, + "queries": [ + { + "description": "", + "kind": "problem", + "name": "Reads and writes on the same file stream shall be separated by a positioning operation", + "precision": "very-high", + "severity": "error", + "short_name": "ReadsAndWritesOnStreamNotSeparatedByPositioning", + "shared_implementation_short_name": "IOFstreamMissingPositioning", + "tags": [ + "correctness", + "scope/system" + ], + "implementation_scope": { + "description": "The rule is enforced in the context of a single function." + } + } + ], + "title": "Reads and writes on the same file stream shall be separated by a positioning operation" + } + } +} \ No newline at end of file diff --git a/rules.csv b/rules.csv index 913aa27282..239ac09023 100644 --- a/rules.csv +++ b/rules.csv @@ -511,7 +511,7 @@ c,CERT-C,ENV31-C,Yes,Rule,,,Do not rely on an environment pointer following an o c,CERT-C,ENV32-C,Yes,Rule,,,All exit handlers must return normally,,Contracts2,Medium, c,CERT-C,ENV33-C,Yes,Rule,,,Do not call system(),"RULE-21-21, M18-0-3",Banned,Easy, c,CERT-C,ENV34-C,Yes,Rule,,,Do not store pointers returned by certain functions,RULE-21-20,Contracts2,Medium, -c,CERT-C,ERR30-C,Yes,Rule,,,"Take care when reading errno",M19-3-1,Contracts4,Hard, +c,CERT-C,ERR30-C,Yes,Rule,,,Take care when reading errno,M19-3-1,Contracts4,Hard, c,CERT-C,ERR32-C,Yes,Rule,,,Do not rely on indeterminate values of errno,,Contracts5,Hard, c,CERT-C,ERR33-C,Yes,Rule,,,Detect and handle standard library errors,MEM52-CPP,Contracts5,Hard, c,CERT-C,ERR34-C,OutOfScope,Rule,,,Detect errors when converting a string to a number,,,, @@ -703,7 +703,7 @@ c,MISRA-C-2012,RULE-15-3,Yes,Required,,,"Any label referenced by a goto statemen c,MISRA-C-2012,RULE-15-4,Yes,Advisory,,,There should be no more than one break or goto statement used to terminate any iteration statement,,Statements2,Medium, c,MISRA-C-2012,RULE-15-5,Yes,Advisory,,,A function should have a single point of exit at the end,,Statements5,Medium, c,MISRA-C-2012,RULE-15-6,Yes,Required,,,The body of an iteration-statement or a selection-statement shall be a compund-statement,M6-3-1,Statements3,Import, -c,MISRA-C-2012,RULE-15-7,Yes,Required,,,All if / else if constructs shall be terminated with an else statement,M6-4-2,Statements3,Import, +c,MISRA-C-2012,RULE-15-7,Yes,Required,,,All if else if constructs shall be terminated with an else statement,M6-4-2,Statements3,Import, c,MISRA-C-2012,RULE-16-1,Yes,Required,,,All switch statements shall be well-formed,M6-4-3,Statements3,Import, c,MISRA-C-2012,RULE-16-2,Yes,Required,,,A switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statement,M6-4-4,Statements1,Import, c,MISRA-C-2012,RULE-16-3,Yes,Required,,,An unconditional break statement shall terminate every switch-clause,M6-4-5,Statements1,Import, @@ -774,182 +774,182 @@ c,MISRA-C-2012,RULE-22-7,Yes,Required,,,The macro EOF shall only be compared wit c,MISRA-C-2012,RULE-22-8,Yes,Required,,,The value of errno shall be set to zero prior to a call to an errno-setting-function,ERR30-C,Contracts3,Medium, c,MISRA-C-2012,RULE-22-9,Yes,Required,,,The value of errno shall be tested against zero after calling an errno-setting-function,,Contracts3,Medium, c,MISRA-C-2012,RULE-22-10,Yes,Required,,,The value of errno shall only be tested when the last function to be called was an errno-setting-function,,Contracts3,Medium, -cpp,MISRA-C++-2023,RULE-0-0-1,Yes,Required,Decidable,Single Translation Unit,A function shall not contain unreachable statements,,,Medium, -cpp,MISRA-C++-2023,RULE-0-0-2,Yes,Advisory,Undecidable,System,Controlling expressions should not be invariant,,,Easy, -cpp,MISRA-C++-2023,RULE-0-1-1,Yes,Advisory,Undecidable,System,A value should not be unnecessarily written to a local object,,,Medium, -cpp,MISRA-C++-2023,RULE-0-1-2,Yes,Required,Decidable,Single Translation Unit,The value returned by a function shall be used,,,Easy, -cpp,MISRA-C++-2023,RULE-0-2-1,Yes,Advisory,Decidable,Single Translation Unit,Variables with limited visibility should be used at least once,,,Easy, -cpp,MISRA-C++-2023,RULE-0-2-2,Yes,Required,Decidable,Single Translation Unit,A named function parameter shall be used at least once,,,Easy, -cpp,MISRA-C++-2023,RULE-0-2-3,Yes,Advisory,Decidable,Single Translation Unit,Types with limited visibility should be used at least once,,,Easy, -cpp,MISRA-C++-2023,RULE-0-2-4,Yes,Advisory,Decidable,System,Functions with limited visibility should be used at least once,,,Easy, +cpp,MISRA-C++-2023,RULE-0-0-1,Yes,Required,Decidable,Single Translation Unit,A function shall not contain unreachable statements,M0-1-1,,Medium, +cpp,MISRA-C++-2023,RULE-0-0-2,Yes,Advisory,Undecidable,System,Controlling expressions should not be invariant,M0-1-2,,Easy, +cpp,MISRA-C++-2023,RULE-0-1-1,Yes,Advisory,Undecidable,System,A value should not be unnecessarily written to a local object,A0-1-1,,Medium, +cpp,MISRA-C++-2023,RULE-0-1-2,Yes,Required,Decidable,Single Translation Unit,The value returned by a function shall be used,A0-1-2,,Easy, +cpp,MISRA-C++-2023,RULE-0-2-1,Yes,Advisory,Decidable,Single Translation Unit,Variables with limited visibility should be used at least once,M0-1-3,,Easy, +cpp,MISRA-C++-2023,RULE-0-2-2,Yes,Required,Decidable,Single Translation Unit,A named function parameter shall be used at least once,"A0-1-4, A0-1-5",,Easy, +cpp,MISRA-C++-2023,RULE-0-2-3,Yes,Advisory,Decidable,Single Translation Unit,Types with limited visibility should be used at least once,A0-1-6,,Easy, +cpp,MISRA-C++-2023,RULE-0-2-4,Yes,Advisory,Decidable,System,Functions with limited visibility should be used at least once,A0-1-3,,Easy, cpp,MISRA-C++-2023,DIR-0-3-1,Yes,Advisory,,,Floating-point arithmetic should be used appropriately,,,Hard, cpp,MISRA-C++-2023,DIR-0-3-2,Yes,Required,,,A function call shall not violate the function’s preconditions,,,Hard, cpp,MISRA-C++-2023,RULE-4-1-1,Yes,Required,Undecidable,System,A program shall conform to ISO/IEC 14882:2017 (C++17),,,Hard, cpp,MISRA-C++-2023,RULE-4-1-2,Yes,Advisory,Decidable,Single Translation Unit,Deprecated features should not be used,,,Very Hard, cpp,MISRA-C++-2023,RULE-4-1-3,Yes,Required,Undecidable,System,There shall be no occurrence of undefined or critical unspecified behaviour,,,Very Hard, -cpp,MISRA-C++-2023,RULE-4-6-1,Yes,Required,Undecidable,System,Operations on a memory location shall be sequenced appropriately,,,Import, -cpp,MISRA-C++-2023,RULE-5-0-1,Yes,Advisory,Decidable,Single Translation Unit,Trigraph-like sequences should not be used,,,Very Hard, -cpp,MISRA-C++-2023,RULE-5-7-1,Yes,Required,Decidable,Single Translation Unit,The character sequence /* shall not be used within a C-style comment,,,Import, -cpp,MISRA-C++-2023,DIR-5-7-2,Yes,Advisory,,,Sections of code should not be “commented out”,,,Import, -cpp,MISRA-C++-2023,RULE-5-7-3,Yes,Required,Decidable,Single Translation Unit,Line-splicing shall not be used in // comments,,,Import, +cpp,MISRA-C++-2023,RULE-4-6-1,Yes,Required,Undecidable,System,Operations on a memory location shall be sequenced appropriately,RULE-13-2,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-5-0-1,Yes,Advisory,Decidable,Single Translation Unit,Trigraph-like sequences should not be used,A2-5-1,,Very Hard, +cpp,MISRA-C++-2023,RULE-5-7-1,Yes,Required,Decidable,Single Translation Unit,The character sequence /* shall not be used within a C-style comment,M2-7-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,DIR-5-7-2,Yes,Advisory,,,Sections of code should not be “commented out”,A2-7-2,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-5-7-3,Yes,Required,Decidable,Single Translation Unit,Line-splicing shall not be used in // comments,A2-7-1,ImportMisra23,Import, cpp,MISRA-C++-2023,RULE-5-10-1,Yes,Required,Decidable,Single Translation Unit,User-defined identifiers shall have an appropriate form,,,Easy, -cpp,MISRA-C++-2023,RULE-5-13-1,Yes,Required,Decidable,Single Translation Unit,"In character literals and non-raw string literals, \ shall only be used to form a defined escape sequence or universal character name",,,Import, -cpp,MISRA-C++-2023,RULE-5-13-2,Yes,Required,Decidable,Single Translation Unit,"Octal escape sequences, hexadecimal escape sequences, and universal character names shall be terminated",,,Import, -cpp,MISRA-C++-2023,RULE-5-13-3,Yes,Required,Decidable,Single Translation Unit,Octal constants shall not be used,,,Import, -cpp,MISRA-C++-2023,RULE-5-13-4,Yes,Required,Decidable,Single Translation Unit,Unsigned integer literals shall be appropriately suffixed,,,Import, -cpp,MISRA-C++-2023,RULE-5-13-5,Yes,Required,Decidable,Single Translation Unit,The lowercase form of L shall not be used as the first character in a literal suffix,,,Import, +cpp,MISRA-C++-2023,RULE-5-13-1,Yes,Required,Decidable,Single Translation Unit,"In character literals and non-raw string literals, \ shall only be used to form a defined escape sequence or universal character name",A2-13-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-5-13-2,Yes,Required,Decidable,Single Translation Unit,"Octal escape sequences, hexadecimal escape sequences, and universal character names shall be terminated",RULE-4-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-5-13-3,Yes,Required,Decidable,Single Translation Unit,Octal constants shall not be used,RULE-7-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-5-13-4,Yes,Required,Decidable,Single Translation Unit,Unsigned integer literals shall be appropriately suffixed,M2-13-3,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-5-13-5,Yes,Required,Decidable,Single Translation Unit,The lowercase form of L shall not be used as the first character in a literal suffix,RULE-7-3,ImportMisra23,Import, cpp,MISRA-C++-2023,RULE-5-13-6,Yes,Required,Decidable,Single Translation Unit,An integer-literal of type long long shall not use a single L or l in any suffix,,,Easy, -cpp,MISRA-C++-2023,RULE-5-13-7,No,Required,Decidable,Single Translation Unit,String literals with different encoding prefixes shall not be concatenated,,,, -cpp,MISRA-C++-2023,RULE-6-0-1,Yes,Required,Decidable,Single Translation Unit,Block scope declarations shall not be visually ambiguous,,,Easy, -cpp,MISRA-C++-2023,RULE-6-0-2,Yes,Advisory,Decidable,Single Translation Unit,"When an array with external linkage is declared, its size should be explicitly specified",,,Easy, -cpp,MISRA-C++-2023,RULE-6-0-3,Yes,Advisory,Decidable,Single Translation Unit,"The only declarations in the global namespace should be main, namespace declarations and extern ""C"" declarations",,,Import, -cpp,MISRA-C++-2023,RULE-6-0-4,Yes,Required,Decidable,Single Translation Unit,The identifier main shall not be used for a function other than the global function main,,,Import, -cpp,MISRA-C++-2023,RULE-6-2-1,Yes,Required,Decidable,System,The one-definition rule shall not be violated,,,Import, -cpp,MISRA-C++-2023,RULE-6-2-2,Yes,Required,Decidable,System,All declarations of a variable or function shall have the same type,,,Easy, +cpp,MISRA-C++-2023,RULE-5-13-7,No,Required,Decidable,Single Translation Unit,String literals with different encoding prefixes shall not be concatenated,A2-13-2,,, +cpp,MISRA-C++-2023,RULE-6-0-1,Yes,Required,Decidable,Single Translation Unit,Block scope declarations shall not be visually ambiguous,"M3-1-2,DCL53-CPP",,Easy, +cpp,MISRA-C++-2023,RULE-6-0-2,Yes,Advisory,Decidable,Single Translation Unit,"When an array with external linkage is declared, its size should be explicitly specified",RULE-18-8,,Easy, +cpp,MISRA-C++-2023,RULE-6-0-3,Yes,Advisory,Decidable,Single Translation Unit,"The only declarations in the global namespace should be main, namespace declarations and extern ""C"" declarations",M7-3-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-6-0-4,Yes,Required,Decidable,Single Translation Unit,The identifier main shall not be used for a function other than the global function main,M7-3-2,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-6-2-1,Yes,Required,Decidable,System,The one-definition rule shall not be violated,M3-2-2,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-6-2-2,Yes,Required,Decidable,System,All declarations of a variable or function shall have the same type,"M3-9-1,DCL40-C",,Easy, cpp,MISRA-C++-2023,RULE-6-2-3,Yes,Required,Decidable,System,The source code used to implement an entity shall appear only once,,,Medium, cpp,MISRA-C++-2023,RULE-6-2-4,Yes,Required,Decidable,Single Translation Unit,A header file shall not contain definitions of functions or objects that are non-inline and have external linkage,,,Easy, -cpp,MISRA-C++-2023,RULE-6-4-1,Yes,Required,Decidable,Single Translation Unit,A variable declared in an inner scope shall not hide a variable declared in an outer scope,,,Import, -cpp,MISRA-C++-2023,RULE-6-4-2,Yes,Required,Decidable,Single Translation Unit,Derived classes shall not conceal functions that are inherited from their bases,,,Import, -cpp,MISRA-C++-2023,RULE-6-4-3,Yes,Required,Decidable,Single Translation Unit,A name that is present in a dependent base shall not be resolved by unqualified lookup,,,Import, +cpp,MISRA-C++-2023,RULE-6-4-1,Yes,Required,Decidable,Single Translation Unit,A variable declared in an inner scope shall not hide a variable declared in an outer scope,A2-10-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-6-4-2,Yes,Required,Decidable,Single Translation Unit,Derived classes shall not conceal functions that are inherited from their bases,A7-3-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-6-4-3,Yes,Required,Decidable,Single Translation Unit,A name that is present in a dependent base shall not be resolved by unqualified lookup,M14-6-1,ImportMisra23,Import, cpp,MISRA-C++-2023,RULE-6-5-1,Yes,Advisory,Decidable,Single Translation Unit,A function or object with external linkage should be introduced in a header file,,,Medium, cpp,MISRA-C++-2023,RULE-6-5-2,Yes,Advisory,Decidable,Single Translation Unit,Internal linkage should be specified appropriately,,,Medium, cpp,MISRA-C++-2023,RULE-6-7-1,Yes,Required,Decidable,Single Translation Unit,Local variables shall not have static storage duration,,,Easy, cpp,MISRA-C++-2023,RULE-6-7-2,Yes,Required,Decidable,Single Translation Unit,Global variables shall not be used,,,Easy, -cpp,MISRA-C++-2023,RULE-6-8-1,Yes,Required,Undecidable,System,An object shall not be accessed outside of its lifetime,,,Import, -cpp,MISRA-C++-2023,RULE-6-8-2,Yes,Mandatory,Decidable,Single Translation Unit,A function must not return a reference or a pointer to a local variable with automatic storage duration,,,Import, +cpp,MISRA-C++-2023,RULE-6-8-1,Yes,Required,Undecidable,System,An object shall not be accessed outside of its lifetime,A3-8-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-6-8-2,Yes,Mandatory,Decidable,Single Translation Unit,A function must not return a reference or a pointer to a local variable with automatic storage duration,M7-5-1,ImportMisra23,Import, cpp,MISRA-C++-2023,RULE-6-8-3,Yes,Required,Decidable,Single Translation Unit,An assignment operator shall not assign the address of an object with automatic storage duration to an object with a greater lifetime,,,Medium, cpp,MISRA-C++-2023,RULE-6-8-4,Yes,Advisory,Decidable,Single Translation Unit,Member functions returning references to their object should be refqualified appropriately,,,Medium, cpp,MISRA-C++-2023,RULE-6-9-1,Yes,Required,Decidable,Single Translation Unit,The same type aliases shall be used in all declarations of the same entity,,,Medium, -cpp,MISRA-C++-2023,RULE-6-9-2,Yes,Advisory,Decidable,Single Translation Unit,The names of the standard signed integer types and standard unsigned integer types should not be used,,,Easy, +cpp,MISRA-C++-2023,RULE-6-9-2,Yes,Advisory,Decidable,Single Translation Unit,The names of the standard signed integer types and standard unsigned integer types should not be used,A3-9-1,,Easy, cpp,MISRA-C++-2023,RULE-7-0-1,Yes,Required,Decidable,Single Translation Unit,There shall be no conversion from type bool,,,Easy, cpp,MISRA-C++-2023,RULE-7-0-2,Yes,Required,Decidable,Single Translation Unit,There shall be no conversion to type bool,,,Easy, -cpp,MISRA-C++-2023,RULE-7-0-3,Yes,Required,Decidable,Single Translation Unit,The numerical value of a character shall not be used,,,Medium, -cpp,MISRA-C++-2023,RULE-7-0-4,Yes,Required,Decidable,Single Translation Unit,The operands of bitwise operators and shift operators shall be appropriate,,,Medium, -cpp,MISRA-C++-2023,RULE-7-0-5,Yes,Required,Decidable,Single Translation Unit,Integral promotion and the usual arithmetic conversions shall not change the signedness or the type category of an operand,,,Medium, +cpp,MISRA-C++-2023,RULE-7-0-3,Yes,Required,Decidable,Single Translation Unit,The numerical value of a character shall not be used,M5-0-11,,Medium, +cpp,MISRA-C++-2023,RULE-7-0-4,Yes,Required,Decidable,Single Translation Unit,The operands of bitwise operators and shift operators shall be appropriate,RULE-10-1,,Medium, +cpp,MISRA-C++-2023,RULE-7-0-5,Yes,Required,Decidable,Single Translation Unit,Integral promotion and the usual arithmetic conversions shall not change the signedness or the type category of an operand,"M5-0-4,M5-0-9,INT31-C",,Medium, cpp,MISRA-C++-2023,RULE-7-0-6,Yes,Required,Decidable,Single Translation Unit,Assignment between numeric types shall be appropriate,,,Hard, -cpp,MISRA-C++-2023,RULE-7-11-1,Yes,Required,Decidable,Single Translation Unit,nullptr shall be the only form of the null-pointer-constant,,,Import, -cpp,MISRA-C++-2023,RULE-7-11-2,Yes,Required,Decidable,Single Translation Unit,An array passed as a function argument shall not decay to a pointer,,,Import, +cpp,MISRA-C++-2023,RULE-7-11-1,Yes,Required,Decidable,Single Translation Unit,nullptr shall be the only form of the null-pointer-constant,A4-10-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-7-11-2,Yes,Required,Decidable,Single Translation Unit,An array passed as a function argument shall not decay to a pointer,M5-2-12,ImportMisra23,Import, cpp,MISRA-C++-2023,RULE-7-11-3,Yes,Required,Decidable,Single Translation Unit,A conversion from function type to pointer-to-function type shall only occur in appropriate contexts,,,Easy, -cpp,MISRA-C++-2023,RULE-8-0-1,Yes,Advisory,Decidable,Single Translation Unit,Parentheses should be used to make the meaning of an expression appropriately explicit,,,Medium, +cpp,MISRA-C++-2023,RULE-8-0-1,Yes,Advisory,Decidable,Single Translation Unit,Parentheses should be used to make the meaning of an expression appropriately explicit,M5-0-2,,Medium, cpp,MISRA-C++-2023,RULE-8-1-1,Yes,Required,Decidable,Single Translation Unit,A non-transient lambda shall not implicitly capture this,,,Easy, -cpp,MISRA-C++-2023,RULE-8-1-2,Yes,Advisory,Decidable,Single Translation Unit,Variables should be captured explicitly in a non-transient lambda,,,Easy, +cpp,MISRA-C++-2023,RULE-8-1-2,Yes,Advisory,Decidable,Single Translation Unit,Variables should be captured explicitly in a non-transient lambda,A5-1-2,,Easy, cpp,MISRA-C++-2023,RULE-8-2-1,Yes,Required,Decidable,Single Translation Unit,A virtual base class shall only be cast to a derived class by means of dynamic_cast,,,Easy, -cpp,MISRA-C++-2023,RULE-8-2-2,Yes,Required,Decidable,Single Translation Unit,C-style casts and functional notation casts shall not be used,,,Easy, -cpp,MISRA-C++-2023,RULE-8-2-3,Yes,Required,Decidable,Single Translation Unit,A cast shall not remove any const or volatile qualification from the type accessed via a pointer or by reference,,,Import, -cpp,MISRA-C++-2023,RULE-8-2-4,Yes,Required,Decidable,Single Translation Unit,Casts shall not be performed between a pointer to function and any other type,,,Import, -cpp,MISRA-C++-2023,RULE-8-2-5,Yes,Required,Decidable,Single Translation Unit,reinterpret_cast shall not be used,,,Import, -cpp,MISRA-C++-2023,RULE-8-2-6,Yes,Required,Decidable,Single Translation Unit,"An object with integral, enumerated, or pointer to void type shall not be cast to a pointer type",,,Easy, -cpp,MISRA-C++-2023,RULE-8-2-7,Yes,Advisory,Decidable,Single Translation Unit,A cast should not convert a pointer type to an integral type,,,Easy, -cpp,MISRA-C++-2023,RULE-8-2-8,Yes,Required,Decidable,Single Translation Unit,An object pointer type shall not be cast to an integral type other than std::uintptr_t or std::intptr_t,,,Easy, +cpp,MISRA-C++-2023,RULE-8-2-2,Yes,Required,Decidable,Single Translation Unit,C-style casts and functional notation casts shall not be used,A5-2-2,,Easy, +cpp,MISRA-C++-2023,RULE-8-2-3,Yes,Required,Decidable,Single Translation Unit,A cast shall not remove any const or volatile qualification from the type accessed via a pointer or by reference,A5-2-3,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-8-2-4,Yes,Required,Decidable,Single Translation Unit,Casts shall not be performed between a pointer to function and any other type,M5-2-6,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-8-2-5,Yes,Required,Decidable,Single Translation Unit,reinterpret_cast shall not be used,A5-2-4,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-8-2-6,Yes,Required,Decidable,Single Translation Unit,"An object with integral, enumerated, or pointer to void type shall not be cast to a pointer type","RULE-11-6, INT36-C",,Easy, +cpp,MISRA-C++-2023,RULE-8-2-7,Yes,Advisory,Decidable,Single Translation Unit,A cast should not convert a pointer type to an integral type,"RULE-11-6, INT36-C",,Easy, +cpp,MISRA-C++-2023,RULE-8-2-8,Yes,Required,Decidable,Single Translation Unit,An object pointer type shall not be cast to an integral type other than std::uintptr_t or std::intptr_t,"RULE-11-6, INT36-C",,Easy, cpp,MISRA-C++-2023,RULE-8-2-9,Yes,Required,Decidable,Single Translation Unit,The operand to typeid shall not be an expression of polymorphic class type,,,Easy, -cpp,MISRA-C++-2023,RULE-8-2-10,Yes,Required,Undecidable,System,"Functions shall not call themselves, either directly or indirectly",,,Import, +cpp,MISRA-C++-2023,RULE-8-2-10,Yes,Required,Undecidable,System,"Functions shall not call themselves, either directly or indirectly",A7-5-2,ImportMisra23,Import, cpp,MISRA-C++-2023,RULE-8-2-11,Yes,Required,Decidable,Single Translation Unit,An argument passed via ellipsis shall have an appropriate type,,,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,,,Import, +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,,,Easy, -cpp,MISRA-C++-2023,RULE-8-7-1,Yes,Required,Undecidable,System,Pointer arithmetic shall not form an invalid pointer,,,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,,,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",,,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,,,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,,,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,,,Import, -cpp,MISRA-C++-2023,RULE-8-19-1,Yes,Advisory,Decidable,Single Translation Unit,The comma operator should not be used,,,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,,,Import, -cpp,MISRA-C++-2023,RULE-9-2-1,Yes,Required,Decidable,Single Translation Unit,An explicit type conversion shall not be an expression statement,,,Easy, -cpp,MISRA-C++-2023,RULE-9-3-1,Yes,Required,Decidable,Single Translation Unit,The body of an iteration-statement or a selection-statement shall be a compound-statement,,,Import, -cpp,MISRA-C++-2023,RULE-9-4-1,Yes,Required,Decidable,Single Translation Unit,All if ... else if constructs shall be terminated with an else statement,,,Import, -cpp,MISRA-C++-2023,RULE-9-4-2,Yes,Required,Decidable,Single Translation Unit,The structure of a switch statement shall be appropriate,,,Medium, +cpp,MISRA-C++-2023,RULE-8-7-1,Yes,Required,Undecidable,System,Pointer arithmetic shall not form an invalid pointer,ARR30-C,,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,,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,,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",,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",,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,M15-8-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, +cpp,MISRA-C++-2023,RULE-9-2-1,Yes,Required,Decidable,Single Translation Unit,An explicit type conversion shall not be an expression statement,DCL53-CPP,,Easy, +cpp,MISRA-C++-2023,RULE-9-3-1,Yes,Required,Decidable,Single Translation Unit,The body of an iteration-statement or a selection-statement shall be a compound-statement,RULE-15-6,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-9-4-1,Yes,Required,Decidable,Single Translation Unit,All if ... else if constructs shall be terminated with an else statement,RULE-15-7,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-9-4-2,Yes,Required,Decidable,Single Translation Unit,The structure of a switch statement shall be appropriate,"RULE-16-1, RULE-16-2,RULE-16-3,RULE-16-4,RULE-16-5,RULE-16-6,RULE-16-7",,Medium, cpp,MISRA-C++-2023,RULE-9-5-1,Yes,Advisory,Decidable,Single Translation Unit,Legacy for statements should be simple,,,Hard, cpp,MISRA-C++-2023,RULE-9-5-2,Yes,Required,Decidable,Single Translation Unit,A for-range-initializer shall contain at most one function call,,,Easy, -cpp,MISRA-C++-2023,RULE-9-6-1,Yes,Advisory,Decidable,Single Translation Unit,The goto statement should not be used,,,Import, -cpp,MISRA-C++-2023,RULE-9-6-2,Yes,Required,Decidable,Single Translation Unit,A goto statement shall reference a label in a surrounding block,,,Import, -cpp,MISRA-C++-2023,RULE-9-6-3,Yes,Required,Decidable,Single Translation Unit,The goto statement shall jump to a label declared later in the function body,,,Import, -cpp,MISRA-C++-2023,RULE-9-6-4,Yes,Required,Undecidable,System,A function declared with the [[noreturn]] attribute shall not return,,,Import, -cpp,MISRA-C++-2023,RULE-9-6-5,Yes,Required,Decidable,Single Translation Unit,A function with non-void return type shall return a value on all paths,,,Import, -cpp,MISRA-C++-2023,RULE-10-0-1,Yes,Advisory,Decidable,Single Translation Unit,A declaration should not declare more than one variable or member variable,,,Import, -cpp,MISRA-C++-2023,RULE-10-1-1,Yes,Advisory,Decidable,Single Translation Unit,The target type of a pointer or lvalue reference parameter should be const-qualified appropriately,,,Hard, +cpp,MISRA-C++-2023,RULE-9-6-1,Yes,Advisory,Decidable,Single Translation Unit,The goto statement should not be used,RULE-15-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-9-6-2,Yes,Required,Decidable,Single Translation Unit,A goto statement shall reference a label in a surrounding block,RULE-15-3,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-9-6-3,Yes,Required,Decidable,Single Translation Unit,The goto statement shall jump to a label declared later in the function body,RULE-15-2,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-9-6-4,Yes,Required,Undecidable,System,A function declared with the [[noreturn]] attribute shall not return,MSC53-CPP,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-9-6-5,Yes,Required,Decidable,Single Translation Unit,A function with non-void return type shall return a value on all paths,MSC52-CPP,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-10-0-1,Yes,Advisory,Decidable,Single Translation Unit,A declaration should not declare more than one variable or member variable,M8-0-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-10-1-1,Yes,Advisory,Decidable,Single Translation Unit,The target type of a pointer or lvalue reference parameter should be const-qualified appropriately,RULE-8-13,,Hard, cpp,MISRA-C++-2023,RULE-10-1-2,Yes,Required,Decidable,Single Translation Unit,The volatile qualifier shall be used appropriately,,,Easy, -cpp,MISRA-C++-2023,RULE-10-2-1,Yes,Required,Decidable,Single Translation Unit,An enumeration shall be defined with an explicit underlying type,,,Import, -cpp,MISRA-C++-2023,RULE-10-2-2,Yes,Advisory,Decidable,Single Translation Unit,Unscoped enumerations should not be declared,,,Easy, -cpp,MISRA-C++-2023,RULE-10-2-3,Yes,Required,Decidable,Single Translation Unit,The numeric value of an unscoped enumeration with no fixed underlying type shall not be used,,,Easy, -cpp,MISRA-C++-2023,RULE-10-3-1,Yes,Advisory,Decidable,Single Translation Unit,There should be no unnamed namespaces in header files,,,Easy, -cpp,MISRA-C++-2023,RULE-10-4-1,Yes,Required,Decidable,Single Translation Unit,The asm declaration shall not be used,,,Import, +cpp,MISRA-C++-2023,RULE-10-2-1,Yes,Required,Decidable,Single Translation Unit,An enumeration shall be defined with an explicit underlying type,A7-2-2,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-10-2-2,Yes,Advisory,Decidable,Single Translation Unit,Unscoped enumerations should not be declared,A7-2-3,,Easy, +cpp,MISRA-C++-2023,RULE-10-2-3,Yes,Required,Decidable,Single Translation Unit,The numeric value of an unscoped enumeration with no fixed underlying type shall not be used,A4-5-1,,Easy, +cpp,MISRA-C++-2023,RULE-10-3-1,Yes,Advisory,Decidable,Single Translation Unit,There should be no unnamed namespaces in header files,"DCL59-CPP, M7-3-3",,Easy, +cpp,MISRA-C++-2023,RULE-10-4-1,Yes,Required,Decidable,Single Translation Unit,The asm declaration shall not be used,A7-4-1,ImportMisra23,Import, cpp,MISRA-C++-2023,RULE-11-3-1,Yes,Advisory,Decidable,Single Translation Unit,Variables of array type should not be declared,,,Easy, -cpp,MISRA-C++-2023,RULE-11-3-2,Yes,Advisory,Decidable,Single Translation Unit,The declaration of an object should contain no more than two levels of pointer indirection,,,Import, +cpp,MISRA-C++-2023,RULE-11-3-2,Yes,Advisory,Decidable,Single Translation Unit,The declaration of an object should contain no more than two levels of pointer indirection,A5-0-3,ImportMisra23,Import, cpp,MISRA-C++-2023,RULE-11-6-1,Yes,Advisory,Decidable,Single Translation Unit,All variables should be initialized,,,Easy, -cpp,MISRA-C++-2023,RULE-11-6-2,Yes,Mandatory,Undecidable,System,The value of an object must not be read before it has been set,,,Very Hard, -cpp,MISRA-C++-2023,RULE-11-6-3,Yes,Required,Decidable,Single Translation Unit,"Within an enumerator list, the value of an implicitly-specified enumeration constant shall be unique",,,Import, -cpp,MISRA-C++-2023,RULE-12-2-1,Yes,Advisory,Decidable,Single Translation Unit,Bit-fields should not be declared,,,Easy, -cpp,MISRA-C++-2023,RULE-12-2-2,Yes,Required,Decidable,Single Translation Unit,A bit-field shall have an appropriate type,,,Import, -cpp,MISRA-C++-2023,RULE-12-2-3,Yes,Required,Decidable,Single Translation Unit,A named bit-field with signed integer type shall not have a length of one bit,,,Import, -cpp,MISRA-C++-2023,RULE-12-3-1,Yes,Required,Decidable,Single Translation Unit,The union keyword shall not be used,,,Easy, +cpp,MISRA-C++-2023,RULE-11-6-2,Yes,Mandatory,Undecidable,System,The value of an object must not be read before it has been set,A8-5-0,,Very Hard, +cpp,MISRA-C++-2023,RULE-11-6-3,Yes,Required,Decidable,Single Translation Unit,"Within an enumerator list, the value of an implicitly-specified enumeration constant shall be unique",RULE-8-12,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-12-2-1,Yes,Advisory,Decidable,Single Translation Unit,Bit-fields should not be declared,A9-6-2,,Easy, +cpp,MISRA-C++-2023,RULE-12-2-2,Yes,Required,Decidable,Single Translation Unit,A bit-field shall have an appropriate type,RULE-6-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-12-2-3,Yes,Required,Decidable,Single Translation Unit,A named bit-field with signed integer type shall not have a length of one bit,"RULE-6-2, M9-6-4",ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-12-3-1,Yes,Required,Decidable,Single Translation Unit,The union keyword shall not be used,RULE-19-2,,Easy, cpp,MISRA-C++-2023,RULE-13-1-1,Yes,Advisory,Decidable,Single Translation Unit,Classes should not be inherited virtually,,,Easy, -cpp,MISRA-C++-2023,RULE-13-1-2,Yes,Required,Decidable,Single Translation Unit,An accessible base class shall not be both virtual and non-virtual in the same hierarchy,,,Import, +cpp,MISRA-C++-2023,RULE-13-1-2,Yes,Required,Decidable,Single Translation Unit,An accessible base class shall not be both virtual and non-virtual in the same hierarchy,M10-1-3,ImportMisra23,Import, cpp,MISRA-C++-2023,RULE-13-3-1,Yes,Required,Decidable,Single Translation Unit,"User-declared member functions shall use the virtual, override and final specifiers appropriately",,,Easy, -cpp,MISRA-C++-2023,RULE-13-3-2,Yes,Required,Decidable,Single Translation Unit,Parameters in an overriding virtual function shall not specify different default arguments,,,Import, -cpp,MISRA-C++-2023,RULE-13-3-3,Yes,Required,Decidable,System,The parameters in all declarations or overrides of a function shall either be unnamed or have identical names,,,Import, -cpp,MISRA-C++-2023,RULE-13-3-4,Yes,Required,Decidable,Single Translation Unit,A comparison of a potentially virtual pointer to member function shall only be with nullptr,,,Import, +cpp,MISRA-C++-2023,RULE-13-3-2,Yes,Required,Decidable,Single Translation Unit,Parameters in an overriding virtual function shall not specify different default arguments,M8-3-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-13-3-3,Yes,Required,Decidable,System,The parameters in all declarations or overrides of a function shall either be unnamed or have identical names,A15-1-2,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-13-3-4,Yes,Required,Decidable,Single Translation Unit,A comparison of a potentially virtual pointer to member function shall only be with nullptr,A5-10-1,ImportMisra23,Import, cpp,MISRA-C++-2023,RULE-14-1-1,Yes,Advisory,Decidable,Single Translation Unit,Non-static data members should be either all private or all public,,,Easy, -cpp,MISRA-C++-2023,RULE-15-0-1,Yes,Required,Decidable,Single Translation Unit,Special member functions shall be provided appropriately,,,Medium, +cpp,MISRA-C++-2023,RULE-15-0-1,Yes,Required,Decidable,Single Translation Unit,Special member functions shall be provided appropriately,A12-0-1,,Medium, cpp,MISRA-C++-2023,RULE-15-0-2,Yes,Advisory,Decidable,Single Translation Unit,User-provided copy and move member functions of a class should have appropriate signatures,,,Easy, -cpp,MISRA-C++-2023,RULE-15-1-1,Yes,Required,Undecidable,System,An object’s dynamic type shall not be used from within its constructor or destructor,,,Import, -cpp,MISRA-C++-2023,RULE-15-1-2,Yes,Advisory,Decidable,Single Translation Unit,All constructors of a class should explicitly initialize all of its virtual base classes and immediate base classes,,,Import, -cpp,MISRA-C++-2023,RULE-15-1-3,Yes,Required,Decidable,Single Translation Unit,Conversion operators and constructors that are callable with a single argument shall be explicit,,,Easy, +cpp,MISRA-C++-2023,RULE-15-1-1,Yes,Required,Undecidable,System,An object’s dynamic type shall not be used from within its constructor or destructor,M12-1-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-15-1-2,Yes,Advisory,Decidable,Single Translation Unit,All constructors of a class should explicitly initialize all of its virtual base classes and immediate base classes,A12-1-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-15-1-3,Yes,Required,Decidable,Single Translation Unit,Conversion operators and constructors that are callable with a single argument shall be explicit,"A12-1-4,A13-5-2",,Easy, cpp,MISRA-C++-2023,RULE-15-1-4,Yes,Advisory,Decidable,Single Translation Unit,"All direct, non-static data members of a class should be initialized before the class object is accessible",,,Hard, -cpp,MISRA-C++-2023,RULE-15-1-5,Yes,Required,Decidable,Single Translation Unit,A class shall only define an initializer-list constructor when it is the only constructor,,,Import, -cpp,MISRA-C++-2023,DIR-15-8-1,Yes,Required,#VALUE!,,User-provided copy assignment operators and move assignment operators shall handle self-assignment,,,Import, -cpp,MISRA-C++-2023,RULE-16-5-1,Yes,Required,Decidable,Single Translation Unit,The logical AND and logical OR operators shall not be overloaded,,,Easy, -cpp,MISRA-C++-2023,RULE-16-5-2,Yes,Required,Decidable,Single Translation Unit,The address-of operator shall not be overloaded,,,Import, +cpp,MISRA-C++-2023,RULE-15-1-5,Yes,Required,Decidable,Single Translation Unit,A class shall only define an initializer-list constructor when it is the only constructor,A8-5-4,ImportMisra23,Import, +cpp,MISRA-C++-2023,DIR-15-8-1,Yes,Required,Decidable,Implementation,User-provided copy assignment operators and move assignment operators shall handle self-assignment,A12-8-5,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-16-5-1,Yes,Required,Decidable,Single Translation Unit,The logical AND and logical OR operators shall not be overloaded,M5-2-11,,Easy, +cpp,MISRA-C++-2023,RULE-16-5-2,Yes,Required,Decidable,Single Translation Unit,The address-of operator shall not be overloaded,M5-3-3,ImportMisra23,Import, cpp,MISRA-C++-2023,RULE-16-6-1,Yes,Advisory,Decidable,Single Translation Unit,Symmetrical operators should only be implemented as non-member functions,,,Medium, -cpp,MISRA-C++-2023,RULE-17-8-1,Yes,Required,Decidable,Single Translation Unit,Function templates shall not be explicitly specialized,,,Import, -cpp,MISRA-C++-2023,RULE-18-1-1,Yes,Required,Decidable,Single Translation Unit,An exception object shall not have pointer type,,,Import, -cpp,MISRA-C++-2023,RULE-18-1-2,Yes,Required,Decidable,Single Translation Unit,An empty throw shall only occur within the compound-statement of a catch handler,,,Import, -cpp,MISRA-C++-2023,RULE-18-3-1,Yes,Advisory,Decidable,Single Translation Unit,There should be at least one exception handler to catch all otherwise unhandled exceptions,,,Easy, -cpp,MISRA-C++-2023,RULE-18-3-2,Yes,Required,Decidable,Single Translation Unit,An exception of class type shall be caught by const reference or reference,,,Easy, -cpp,MISRA-C++-2023,RULE-18-3-3,Yes,Required,Decidable,Single Translation Unit,Handlers for a function-try-block of a constructor or destructor shall not refer to non-static members from their class or its bases,,,Import, -cpp,MISRA-C++-2023,RULE-18-4-1,Yes,Required,Decidable,Single Translation Unit,Exception-unfriendly functions shall be noexcept,,,Easy, -cpp,MISRA-C++-2023,RULE-18-5-1,Yes,Advisory,Undecidable,System,A noexcept function should not attempt to propagate an exception to the calling function,,,Import, +cpp,MISRA-C++-2023,RULE-17-8-1,Yes,Required,Decidable,Single Translation Unit,Function templates shall not be explicitly specialized,A14-8-2,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-18-1-1,Yes,Required,Decidable,Single Translation Unit,An exception object shall not have pointer type,A15-1-2,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-18-1-2,Yes,Required,Decidable,Single Translation Unit,An empty throw shall only occur within the compound-statement of a catch handler,M15-1-3,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-18-3-1,Yes,Advisory,Decidable,Single Translation Unit,There should be at least one exception handler to catch all otherwise unhandled exceptions,A15-3-3,,Easy, +cpp,MISRA-C++-2023,RULE-18-3-2,Yes,Required,Decidable,Single Translation Unit,An exception of class type shall be caught by const reference or reference,A15-3-5,,Easy, +cpp,MISRA-C++-2023,RULE-18-3-3,Yes,Required,Decidable,Single Translation Unit,Handlers for a function-try-block of a constructor or destructor shall not refer to non-static members from their class or its bases,M15-3-3,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-18-4-1,Yes,Required,Decidable,Single Translation Unit,Exception-unfriendly functions shall be noexcept,A15-5-1,,Easy, +cpp,MISRA-C++-2023,RULE-18-5-1,Yes,Advisory,Undecidable,System,A noexcept function should not attempt to propagate an exception to the calling function,A15-4-2,ImportMisra23,Import, cpp,MISRA-C++-2023,RULE-18-5-2,Yes,Advisory,Decidable,Single Translation Unit,Program-terminating functions should not be used,,,Easy, cpp,MISRA-C++-2023,RULE-19-0-1,No,Required,Decidable,Single Translation Unit,A line whose first token is # shall be a valid preprocessing directive,,,, -cpp,MISRA-C++-2023,RULE-19-0-2,Yes,Required,Decidable,Single Translation Unit,Function-like macros shall not be defined,,,Import, -cpp,MISRA-C++-2023,RULE-19-0-3,Yes,Advisory,Decidable,Single Translation Unit,#include directives should only be preceded by preprocessor directives or comments,,,Import, +cpp,MISRA-C++-2023,RULE-19-0-2,Yes,Required,Decidable,Single Translation Unit,Function-like macros shall not be defined,DIR-4-9,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-19-0-3,Yes,Advisory,Decidable,Single Translation Unit,#include directives should only be preceded by preprocessor directives or comments,RULE-20-1,ImportMisra23,Import, cpp,MISRA-C++-2023,RULE-19-0-4,Yes,Advisory,Decidable,Single Translation Unit,#undef should only be used for macros defined previously in the same file,,,Easy, -cpp,MISRA-C++-2023,RULE-19-1-1,Yes,Required,Decidable,Single Translation Unit,The defined preprocessor operator shall be used appropriately,,,Easy, -cpp,MISRA-C++-2023,RULE-19-1-2,No,Required,Decidable,Single Translation Unit,"All #else, #elif and #endif preprocessor directives shall reside in the same file as the #if, #ifdef or #ifndef directive to which they are related",,,, -cpp,MISRA-C++-2023,RULE-19-1-3,Yes,Required,Decidable,Single Translation Unit,All identifiers used in the controlling expression of #if or #elif preprocessing directives shall be defined prior to evaluation,,,Import, -cpp,MISRA-C++-2023,RULE-19-2-1,Yes,Required,Decidable,Single Translation Unit,Precautions shall be taken in order to prevent the contents of a header file being included more than once,,,Easy, +cpp,MISRA-C++-2023,RULE-19-1-1,Yes,Required,Decidable,Single Translation Unit,The defined preprocessor operator shall be used appropriately,M16-1-1,,Easy, +cpp,MISRA-C++-2023,RULE-19-1-2,No,Required,Decidable,Single Translation Unit,"All #else, #elif and #endif preprocessor directives shall reside in the same file as the #if, #ifdef or #ifndef directive to which they are related",M16-1-2,,, +cpp,MISRA-C++-2023,RULE-19-1-3,Yes,Required,Decidable,Single Translation Unit,All identifiers used in the controlling expression of #if or #elif preprocessing directives shall be defined prior to evaluation,M16-0-7,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-19-2-1,Yes,Required,Decidable,Single Translation Unit,Precautions shall be taken in order to prevent the contents of a header file being included more than once,M16-2-3,,Easy, cpp,MISRA-C++-2023,RULE-19-2-2,Yes,Required,Decidable,Single Translation Unit,"The #include directive shall be followed by either a or ""filename"" sequence",,,Easy, -cpp,MISRA-C++-2023,RULE-19-2-3,Yes,Required,Decidable,Single Translation Unit,"The ' or "" or \ characters and the /* or // character sequences shall not occur in a header file name",,,Import, -cpp,MISRA-C++-2023,RULE-19-3-1,Yes,Advisory,Decidable,Single Translation Unit,The # and ## preprocessor operators should not be used,,,Import, -cpp,MISRA-C++-2023,RULE-19-3-2,Yes,Required,Decidable,Single Translation Unit,A macro parameter immediately following a # operator shall not be immediately followed by a ## operator,,,Import, -cpp,MISRA-C++-2023,RULE-19-3-3,Yes,Required,Decidable,Single Translation Unit,The argument to a mixed-use macro parameter shall not be subject to further expansion,,,Import, -cpp,MISRA-C++-2023,RULE-19-3-4,Yes,Required,Decidable,Single Translation Unit,Parentheses shall be used to ensure macro arguments are expanded appropriately,,,Medium, -cpp,MISRA-C++-2023,RULE-19-3-5,Yes,Required,Decidable,Single Translation Unit,Tokens that look like a preprocessing directive shall not occur within a macro argument,,,Import, -cpp,MISRA-C++-2023,RULE-19-6-1,Yes,Advisory,Decidable,Single Translation Unit,The #pragma directive and the _Pragma operator should not be used,,,Easy, -cpp,MISRA-C++-2023,RULE-21-2-1,Yes,Required,Decidable,Single Translation Unit,"The library functions atof, atoi, atol and atoll from shall not be used",,,Import, -cpp,MISRA-C++-2023,RULE-21-2-2,Yes,Required,Decidable,Single Translation Unit,"The string handling functions from , , and shall not be used",,,Easy, -cpp,MISRA-C++-2023,RULE-21-2-3,Yes,Required,Decidable,Single Translation Unit,The library function system from shall not be used,,,Easy, -cpp,MISRA-C++-2023,RULE-21-2-4,Yes,Required,Decidable,Single Translation Unit,The macro offsetof shall not be used,,,Import, -cpp,MISRA-C++-2023,RULE-21-6-1,Yes,Advisory,Undecidable,Single Translation Unit,Dynamic memory should not be used,,,Easy, +cpp,MISRA-C++-2023,RULE-19-2-3,Yes,Required,Decidable,Single Translation Unit,"The ' or "" or \ characters and the /* or // character sequences shall not occur in a header file name",A16-2-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-19-3-1,Yes,Advisory,Decidable,Single Translation Unit,The # and ## preprocessor operators should not be used,M16-3-2,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-19-3-2,Yes,Required,Decidable,Single Translation Unit,A macro parameter immediately following a # operator shall not be immediately followed by a ## operator,RULE-20-11,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-19-3-3,Yes,Required,Decidable,Single Translation Unit,The argument to a mixed-use macro parameter shall not be subject to further expansion,RULE-20-12,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-19-3-4,Yes,Required,Decidable,Single Translation Unit,Parentheses shall be used to ensure macro arguments are expanded appropriately,M16-0-6,,Medium, +cpp,MISRA-C++-2023,RULE-19-3-5,Yes,Required,Decidable,Single Translation Unit,Tokens that look like a preprocessing directive shall not occur within a macro argument,RULE-20-6,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-19-6-1,Yes,Advisory,Decidable,Single Translation Unit,The #pragma directive and the _Pragma operator should not be used,A16-7-1,,Easy, +cpp,MISRA-C++-2023,RULE-21-2-1,Yes,Required,Decidable,Single Translation Unit,"The library functions atof, atoi, atol and atoll from shall not be used",RULE-21-7,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-21-2-2,Yes,Required,Decidable,Single Translation Unit,"The string handling functions from , , and shall not be used",M18-0-5,,Easy, +cpp,MISRA-C++-2023,RULE-21-2-3,Yes,Required,Decidable,Single Translation Unit,The library function system from shall not be used,M18-0-3,,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,,Easy, cpp,MISRA-C++-2023,RULE-21-6-2,Yes,Required,Decidable,Single Translation Unit,Dynamic memory shall be managed automatically,,,Easy, cpp,MISRA-C++-2023,RULE-21-6-3,Yes,Required,Decidable,Single Translation Unit,Advanced memory management shall not be used,,,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",,,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,,,Import, -cpp,MISRA-C++-2023,RULE-21-10-1,Yes,Required,Decidable,Single Translation Unit,The features of shall not be used,,,Easy, -cpp,MISRA-C++-2023,RULE-21-10-2,Yes,Required,Decidable,Single Translation Unit,The standard header file shall not be used,,,Easy, -cpp,MISRA-C++-2023,RULE-21-10-3,Yes,Required,Decidable,Single Translation Unit,The facilities provided by the standard header file shall not be used,,,Import, +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 shall not be used,DCL50-CPP,,Easy, +cpp,MISRA-C++-2023,RULE-21-10-2,Yes,Required,Decidable,Single Translation Unit,The standard header file shall not be used,ERR52-CPP,,Easy, +cpp,MISRA-C++-2023,RULE-21-10-3,Yes,Required,Decidable,Single Translation Unit,The facilities provided by the standard header file shall not be used,M18-7-1,ImportMisra23,Import, cpp,MISRA-C++-2023,RULE-22-3-1,Yes,Required,Decidable,Single Translation Unit,The assert macro shall not be used with a constant-expression,,,Easy, cpp,MISRA-C++-2023,RULE-22-4-1,Yes,Required,Decidable,Single Translation Unit,The literal value zero shall be the only value assigned to errno,,,Easy, cpp,MISRA-C++-2023,RULE-23-11-1,Yes,Advisory,Decidable,Single Translation Unit,The raw pointer constructors of std::shared_ptr and std::unique_ptr should not be used,,,Easy, cpp,MISRA-C++-2023,RULE-24-5-1,Yes,Required,Decidable,Single Translation Unit,The character handling functions from and shall not be used,,,Easy, cpp,MISRA-C++-2023,RULE-24-5-2,Yes,Required,Decidable,Single Translation Unit,"The C++ Standard Library functions memcpy, memmove and memcmp from shall not be used",,,Easy, cpp,MISRA-C++-2023,RULE-25-5-1,Yes,Required,Decidable,Single Translation Unit,The setlocale and std::locale::global functions shall not be called,,,Easy, -cpp,MISRA-C++-2023,RULE-25-5-2,Yes,Mandatory,Decidable,Single Translation Unit,"The pointers returned by the C++ Standard Library functions localeconv, getenv, setlocale or strerror must only be used as if they have pointer to const-qualified type",,,Import, -cpp,MISRA-C++-2023,RULE-25-5-3,Yes,Mandatory,Undecidable,System,"The pointer returned by the C++ Standard Library functions asctime, ctime, gmtime, localtime, localeconv, getenv, setlocale or strerror must not be used following a subsequent call to the same function",,,Import, -cpp,MISRA-C++-2023,RULE-26-3-1,Yes,Advisory,Decidable,Single Translation Unit,std::vector should not be specialized with bool,,,Import, -cpp,MISRA-C++-2023,RULE-28-3-1,Yes,Required,Undecidable,System,Predicates shall not have persistent side effects,,,Easy, -cpp,MISRA-C++-2023,RULE-28-6-1,Yes,Required,Decidable,Single Translation Unit,The argument to std::move shall be a non-const lvalue,,,Easy, -cpp,MISRA-C++-2023,RULE-28-6-2,Yes,Required,Decidable,Single Translation Unit,Forwarding references and std::forward shall be used together,,,Import, -cpp,MISRA-C++-2023,RULE-28-6-3,Yes,Required,Decidable,Single Translation Unit,An object shall not be used while in a potentially moved-from state,,,Import, +cpp,MISRA-C++-2023,RULE-25-5-2,Yes,Mandatory,Decidable,Single Translation Unit,"The pointers returned by the C++ Standard Library functions localeconv, getenv, setlocale or strerror must only be used as if they have pointer to const-qualified type",RULE-21-19,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-25-5-3,Yes,Mandatory,Undecidable,System,"The pointer returned by the C++ Standard Library functions asctime, ctime, gmtime, localtime, localeconv, getenv, setlocale or strerror must not be used following a subsequent call to the same function",RULE-21-20,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-26-3-1,Yes,Advisory,Decidable,Single Translation Unit,std::vector should not be specialized with bool,A18-1-2,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-28-3-1,Yes,Required,Undecidable,System,Predicates shall not have persistent side effects,A25-1-1,,Easy, +cpp,MISRA-C++-2023,RULE-28-6-1,Yes,Required,Decidable,Single Translation Unit,The argument to std::move shall be a non-const lvalue,A18-9-3,,Easy, +cpp,MISRA-C++-2023,RULE-28-6-2,Yes,Required,Decidable,Single Translation Unit,Forwarding references and std::forward shall be used together,A18-9-2,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-28-6-3,Yes,Required,Decidable,Single Translation Unit,An object shall not be used while in a potentially moved-from state,A12-8-3,ImportMisra23,Import, cpp,MISRA-C++-2023,RULE-28-6-4,Yes,Required,Decidable,Single Translation Unit,"The result of std::remove, std::remove_if, std::unique and empty shall be used",,,Easy, -cpp,MISRA-C++-2023,RULE-30-0-1,Yes,Required,Decidable,Single Translation Unit,The C Library input/output functions shall not be used,,,Import, -cpp,MISRA-C++-2023,RULE-30-0-2,Yes,Required,Undecidable,System,Reads and writes on the same file stream shall be separated by a positioning operation,,,Import, \ No newline at end of file +cpp,MISRA-C++-2023,RULE-30-0-1,Yes,Required,Decidable,Single Translation Unit,The C Library input/output functions shall not be used,M27-0-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-30-0-2,Yes,Required,Undecidable,System,Reads and writes on the same file stream shall be separated by a positioning operation,A27-0-3,ImportMisra23,Import, From c9b176b8c406c77ea966df8a081ea67a9a3fb6f2 Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Thu, 16 May 2024 17:15:41 +0200 Subject: [PATCH 6/7] Revert "Rules with preexisting import" This reverts commit 0b965ffb4c6e6c5ca2b8f1972a7f194bef8ba058. --- .../cpp/exclusions/cpp/ImportMisra23.qll | 1319 ----------------- .../cpp/exclusions/cpp/RuleMetadata.qll | 3 - .../SectionsOfCodeShouldNotBeCommentedOut.ql | 23 - .../DeclarationOfAnObjectIndirectionsLevel.ql | 24 - ...rsReferToNonStaticMembersFromTheirClass.ql | 24 - ...ectivesPrecededByPreprocessorDirectives.ql | 23 - ...tifiersUsedInTheControllingExpressionOf.ql | 25 - ...CharsThatShouldNotOccurInHeaderFileName.ql | 24 - ...AndPreprocessorOperatorsShouldNotBeUsed.ql | 23 - ...sThatLookLikeDirectivesInAMacroArgument.ql | 24 - .../PointerToAnIncompleteClassTypeDeleted.ql | 23 - ...urnedByLocaleFunctionsMustBeUsedAsConst.ql | 26 - ...lToSetlocaleInvalidatesOldPointersMisra.ql | 25 - ...etlocaleInvalidatesOldPointersWarnMisra.ql | 25 - ...ectUsedWhileInPotentiallyMovedFromState.ql | 23 - ...WritesOnStreamNotSeparatedByPositioning.ql | 23 - .../RULE-6-2-1/OneDefinitionRuleViolated.ql | 23 - ...ableDeclaredInInnerScopeHidesOuterScope.ql | 24 - .../ObjectAccessedAfterLifetimeMisra.ql | 23 - .../ObjectAccessedBeforeLifetimeMisra.ql | 23 - ...esConstOrVolatileFromPointerOrReference.ql | 24 - .../rules/RULE-9-4-1/IfElseIfEndCondition.ql | 24 - ...llJumpToLabelDeclaredLaterInTheFunction.ql | 24 - ...nDeclaredWithTheNoreturnAttributeReturn.ql | 23 - ...VoidFunctionShallReturnAValueOnAllPaths.ql | 23 - ...tionsOfCodeShouldNotBeCommentedOut.testref | 1 - ...arationOfAnObjectIndirectionsLevel.testref | 1 - ...erToNonStaticMembersFromTheirClass.testref | 1 - ...esPrecededByPreprocessorDirectives.testref | 1 - ...rsUsedInTheControllingExpressionOf.testref | 1 - ...ThatShouldNotOccurInHeaderFileName.testref | 1 - ...eprocessorOperatorsShouldNotBeUsed.testref | 1 - ...LookLikeDirectivesInAMacroArgument.testref | 1 - ...nterToAnIncompleteClassTypeDeleted.testref | 1 - ...ByLocaleFunctionsMustBeUsedAsConst.testref | 1 - ...tlocaleInvalidatesOldPointersMisra.testref | 1 - ...aleInvalidatesOldPointersWarnMisra.testref | 1 - ...edWhileInPotentiallyMovedFromState.testref | 1 - ...sOnStreamNotSeparatedByPositioning.testref | 1 - .../OneDefinitionRuleViolated.testref | 1 - ...eclaredInInnerScopeHidesOuterScope.testref | 1 - .../ObjectAccessedAfterLifetimeMisra.testref | 1 - .../ObjectAccessedBeforeLifetimeMisra.testref | 1 - ...stOrVolatileFromPointerOrReference.testref | 1 - .../RULE-9-4-1/IfElseIfEndCondition.testref | 1 - ...pToLabelDeclaredLaterInTheFunction.testref | 1 - ...aredWithTheNoreturnAttributeReturn.testref | 1 - ...unctionShallReturnAValueOnAllPaths.testref | 1 - rule_packages/cpp/ImportMisra23.json | 505 ------- rules.csv | 264 ++-- 50 files changed, 132 insertions(+), 2528 deletions(-) delete mode 100644 cpp/common/src/codingstandards/cpp/exclusions/cpp/ImportMisra23.qll delete mode 100644 cpp/misra/src/rules/DIR-5-7-2/SectionsOfCodeShouldNotBeCommentedOut.ql delete mode 100644 cpp/misra/src/rules/RULE-11-3-2/DeclarationOfAnObjectIndirectionsLevel.ql delete mode 100644 cpp/misra/src/rules/RULE-18-3-3/HandlersReferToNonStaticMembersFromTheirClass.ql delete mode 100644 cpp/misra/src/rules/RULE-19-0-3/IncludeDirectivesPrecededByPreprocessorDirectives.ql delete mode 100644 cpp/misra/src/rules/RULE-19-1-3/IdentifiersUsedInTheControllingExpressionOf.ql delete mode 100644 cpp/misra/src/rules/RULE-19-2-3/CharsThatShouldNotOccurInHeaderFileName.ql delete mode 100644 cpp/misra/src/rules/RULE-19-3-1/AndPreprocessorOperatorsShouldNotBeUsed.ql delete mode 100644 cpp/misra/src/rules/RULE-19-3-5/TokensThatLookLikeDirectivesInAMacroArgument.ql delete mode 100644 cpp/misra/src/rules/RULE-21-6-5/PointerToAnIncompleteClassTypeDeleted.ql delete mode 100644 cpp/misra/src/rules/RULE-25-5-2/PointersReturnedByLocaleFunctionsMustBeUsedAsConst.ql delete mode 100644 cpp/misra/src/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersMisra.ql delete mode 100644 cpp/misra/src/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersWarnMisra.ql delete mode 100644 cpp/misra/src/rules/RULE-28-6-3/ObjectUsedWhileInPotentiallyMovedFromState.ql delete mode 100644 cpp/misra/src/rules/RULE-30-0-2/ReadsAndWritesOnStreamNotSeparatedByPositioning.ql delete mode 100644 cpp/misra/src/rules/RULE-6-2-1/OneDefinitionRuleViolated.ql delete mode 100644 cpp/misra/src/rules/RULE-6-4-1/VariableDeclaredInInnerScopeHidesOuterScope.ql delete mode 100644 cpp/misra/src/rules/RULE-6-8-1/ObjectAccessedAfterLifetimeMisra.ql delete mode 100644 cpp/misra/src/rules/RULE-6-8-1/ObjectAccessedBeforeLifetimeMisra.ql delete mode 100644 cpp/misra/src/rules/RULE-8-2-3/CastRemovesConstOrVolatileFromPointerOrReference.ql delete mode 100644 cpp/misra/src/rules/RULE-9-4-1/IfElseIfEndCondition.ql delete mode 100644 cpp/misra/src/rules/RULE-9-6-3/GotoShallJumpToLabelDeclaredLaterInTheFunction.ql delete mode 100644 cpp/misra/src/rules/RULE-9-6-4/FunctionDeclaredWithTheNoreturnAttributeReturn.ql delete mode 100644 cpp/misra/src/rules/RULE-9-6-5/NonVoidFunctionShallReturnAValueOnAllPaths.ql delete mode 100644 cpp/misra/test/rules/DIR-5-7-2/SectionsOfCodeShouldNotBeCommentedOut.testref delete mode 100644 cpp/misra/test/rules/RULE-11-3-2/DeclarationOfAnObjectIndirectionsLevel.testref delete mode 100644 cpp/misra/test/rules/RULE-18-3-3/HandlersReferToNonStaticMembersFromTheirClass.testref delete mode 100644 cpp/misra/test/rules/RULE-19-0-3/IncludeDirectivesPrecededByPreprocessorDirectives.testref delete mode 100644 cpp/misra/test/rules/RULE-19-1-3/IdentifiersUsedInTheControllingExpressionOf.testref delete mode 100644 cpp/misra/test/rules/RULE-19-2-3/CharsThatShouldNotOccurInHeaderFileName.testref delete mode 100644 cpp/misra/test/rules/RULE-19-3-1/AndPreprocessorOperatorsShouldNotBeUsed.testref delete mode 100644 cpp/misra/test/rules/RULE-19-3-5/TokensThatLookLikeDirectivesInAMacroArgument.testref delete mode 100644 cpp/misra/test/rules/RULE-21-6-5/PointerToAnIncompleteClassTypeDeleted.testref delete mode 100644 cpp/misra/test/rules/RULE-25-5-2/PointersReturnedByLocaleFunctionsMustBeUsedAsConst.testref delete mode 100644 cpp/misra/test/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersMisra.testref delete mode 100644 cpp/misra/test/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersWarnMisra.testref delete mode 100644 cpp/misra/test/rules/RULE-28-6-3/ObjectUsedWhileInPotentiallyMovedFromState.testref delete mode 100644 cpp/misra/test/rules/RULE-30-0-2/ReadsAndWritesOnStreamNotSeparatedByPositioning.testref delete mode 100644 cpp/misra/test/rules/RULE-6-2-1/OneDefinitionRuleViolated.testref delete mode 100644 cpp/misra/test/rules/RULE-6-4-1/VariableDeclaredInInnerScopeHidesOuterScope.testref delete mode 100644 cpp/misra/test/rules/RULE-6-8-1/ObjectAccessedAfterLifetimeMisra.testref delete mode 100644 cpp/misra/test/rules/RULE-6-8-1/ObjectAccessedBeforeLifetimeMisra.testref delete mode 100644 cpp/misra/test/rules/RULE-8-2-3/CastRemovesConstOrVolatileFromPointerOrReference.testref delete mode 100644 cpp/misra/test/rules/RULE-9-4-1/IfElseIfEndCondition.testref delete mode 100644 cpp/misra/test/rules/RULE-9-6-3/GotoShallJumpToLabelDeclaredLaterInTheFunction.testref delete mode 100644 cpp/misra/test/rules/RULE-9-6-4/FunctionDeclaredWithTheNoreturnAttributeReturn.testref delete mode 100644 cpp/misra/test/rules/RULE-9-6-5/NonVoidFunctionShallReturnAValueOnAllPaths.testref delete mode 100644 rule_packages/cpp/ImportMisra23.json diff --git a/cpp/common/src/codingstandards/cpp/exclusions/cpp/ImportMisra23.qll b/cpp/common/src/codingstandards/cpp/exclusions/cpp/ImportMisra23.qll deleted file mode 100644 index b8fef48f1f..0000000000 --- a/cpp/common/src/codingstandards/cpp/exclusions/cpp/ImportMisra23.qll +++ /dev/null @@ -1,1319 +0,0 @@ -//** THIS FILE IS AUTOGENERATED, DO NOT MODIFY DIRECTLY. **/ -import cpp -import RuleMetadata -import codingstandards.cpp.exclusions.RuleMetadata - -newtype ImportMisra23Query = - TUserCopyAndMoveAssignmentShallHandleSelfAssignmentQuery() or - TSectionsOfCodeShouldNotBeCommentedOutQuery() or - TDeclarationShouldNotDeclareMoreThanOneVariableQuery() or - TEnumerationNotDefinedWithAnExplicitUnderlyingTypeQuery() or - TAsmDeclarationShallNotBeUsedQuery() or - TDeclarationOfAnObjectIndirectionsLevelQuery() or - TValueOfAnEnumerationConstantNotUniqueQuery() or - TBitFieldShallHaveAnAppropriateTypeQuery() or - TSignedIntegerBitFieldHaveALengthOfOneBitQuery() or - TVirtualAndNonVirtualBaseClassInHierarchyQuery() or - TDifferentDefaultArgsInOverridingVirtualFunctionQuery() or - TDeclarationsOrOverridesParamsAreUnnamedOrIdenticalQuery() or - TComparisonOfVirtualPointerOnlyBeWithNullptrQuery() or - TDynamicTypeUsedWithinConstructorOrDestructorQuery() or - TConstructorsShouldInitializeAllBaseClassesQuery() or - TInitializerListConstructorIsTheOnlyConstructorQuery() or - TAddressOfOperatorOverloadedQuery() or - TFunctionTemplatesExplicitlySpecializedQuery() or - TExceptionObjectHavePointerTypeQuery() or - TEmptyThrowShallOnlyOccurWithinACatchHandlerQuery() or - THandlersReferToNonStaticMembersFromTheirClassQuery() or - TNoexceptFunctionShouldNotPropagateAnExceptionQuery() or - TFunctionLikeMacrosDefinedQuery() or - TIncludeDirectivesPrecededByPreprocessorDirectivesQuery() or - TIdentifiersUsedInTheControllingExpressionOfQuery() or - TCharsThatShouldNotOccurInHeaderFileNameQuery() or - TAndPreprocessorOperatorsShouldNotBeUsedQuery() or - TMacroParameterFollowingAHashOperatorQuery() or - TArgumentToAMixedUseMacroShoulNotNeedExpansionQuery() or - TTokensThatLookLikeDirectivesInAMacroArgumentQuery() or - TFacilitiesProvidedByCsignalUsedQuery() or - TAtofAtoiAtolAndAtollFromCstdlibUsedQuery() or - TMacroOffsetShouldNotBeUsedQuery() or - TDefineBothSizedAndUnsizedVersionOfAGlobalOperatorQuery() or - TPointerToAnIncompleteClassTypeDeletedQuery() or - TPointersReturnedByLocaleFunctionsMustBeUsedAsConstQuery() or - TCallToSetlocaleInvalidatesOldPointersMisraQuery() or - TCallToSetlocaleInvalidatesOldPointersWarnMisraQuery() or - TVectorShouldNotBeSpecializedWithBoolQuery() or - TForwardingReferencesAndForwardNotUsedTogetherQuery() or - TObjectUsedWhileInPotentiallyMovedFromStateQuery() or - TCLibraryInputoutputFunctionsUsedQuery() or - TReadsAndWritesOnStreamNotSeparatedByPositioningQuery() or - TOperationsOnMemoryNotSequencedAppropriatelyQuery() or - TCharacterOnlyInEscapeSequenceOrUniversalCharNameQuery() or - TEscapeSequencesAndUniversalCharNamesNotTerminatedQuery() or - TOctalConstantsUsedQuery() or - TUnsignedIntegerLiteralsNotAppropriatelySuffixedQuery() or - TLowercaseLUsedAsFirstCharacterInLiteralSuffixQuery() or - TCharacterSequenceUsedWithinACStyleCommentQuery() or - TLineSplicingUsedInCommentsQuery() or - TGlobalDeclarationsOnlyMainNamespaceOrExternCQuery() or - TMainUsedOnlyForTheGlobalFunctionMainQuery() or - TOneDefinitionRuleViolatedQuery() or - TVariableDeclaredInInnerScopeHidesOuterScopeQuery() or - TDerivedClasseConcealFunctionInheritedFromTheBaseQuery() or - TNameInDependentBaseResolvedByUnqualifiedLookupQuery() or - TObjectAccessedBeforeLifetimeMisraQuery() or - TObjectAccessedAfterLifetimeMisraQuery() or - TMustNotReturnReferenceToLocalAutomaticVariableQuery() or - TNullptrNotTheOnlyFormOfTheNullPointerConstantQuery() or - TArrayPassedAsFunctionArgumentDecayToAPointerQuery() or - TResultOfAnAssignmentOperatorShouldNotBeUsedQuery() or - TCommaOperatorShouldNotBeUsedQuery() or - TFunctionsCallThemselvesEitherDirectlyOrIndirectlyQuery() or - TCastRemovesConstOrVolatileFromPointerOrReferenceQuery() or - TCastsBetweenAPointerToFunctionAndAnyOtherTypeQuery() or - TReinterpretCastShallNotBeUsedQuery() or - TUnsignedOperationWithConstantOperandsShouldNotWrapQuery() or - TBuiltInOperatorAppliedToUnsignedExpressionQuery() or - TBodyOfIterationOrSelectionStatementNotCompoundQuery() or - TIfElseIfEndConditionQuery() or - TGotoStatementShouldNotBeUsedQuery() or - TGotoShallReferenceALabelInSurroundingBlockQuery() or - TGotoShallJumpToLabelDeclaredLaterInTheFunctionQuery() or - TFunctionDeclaredWithTheNoreturnAttributeReturnQuery() or - TNonVoidFunctionShallReturnAValueOnAllPathsQuery() - -predicate isImportMisra23QueryMetadata(Query query, string queryId, string ruleId, string category) { - query = - // `Query` instance for the `userCopyAndMoveAssignmentShallHandleSelfAssignment` query - ImportMisra23Package::userCopyAndMoveAssignmentShallHandleSelfAssignmentQuery() and - queryId = - // `@id` for the `userCopyAndMoveAssignmentShallHandleSelfAssignment` query - "cpp/misra/user-copy-and-move-assignment-shall-handle-self-assignment" and - ruleId = "DIR-15-8-1" and - category = "required" - or - query = - // `Query` instance for the `sectionsOfCodeShouldNotBeCommentedOut` query - ImportMisra23Package::sectionsOfCodeShouldNotBeCommentedOutQuery() and - queryId = - // `@id` for the `sectionsOfCodeShouldNotBeCommentedOut` query - "cpp/misra/sections-of-code-should-not-be-commented-out" and - ruleId = "DIR-5-7-2" and - category = "advisory" - or - query = - // `Query` instance for the `declarationShouldNotDeclareMoreThanOneVariable` query - ImportMisra23Package::declarationShouldNotDeclareMoreThanOneVariableQuery() and - queryId = - // `@id` for the `declarationShouldNotDeclareMoreThanOneVariable` query - "cpp/misra/declaration-should-not-declare-more-than-one-variable" and - ruleId = "RULE-10-0-1" and - category = "advisory" - or - query = - // `Query` instance for the `enumerationNotDefinedWithAnExplicitUnderlyingType` query - ImportMisra23Package::enumerationNotDefinedWithAnExplicitUnderlyingTypeQuery() and - queryId = - // `@id` for the `enumerationNotDefinedWithAnExplicitUnderlyingType` query - "cpp/misra/enumeration-not-defined-with-an-explicit-underlying-type" and - ruleId = "RULE-10-2-1" and - category = "required" - or - query = - // `Query` instance for the `asmDeclarationShallNotBeUsed` query - ImportMisra23Package::asmDeclarationShallNotBeUsedQuery() and - queryId = - // `@id` for the `asmDeclarationShallNotBeUsed` query - "cpp/misra/asm-declaration-shall-not-be-used" and - ruleId = "RULE-10-4-1" and - category = "required" - or - query = - // `Query` instance for the `declarationOfAnObjectIndirectionsLevel` query - ImportMisra23Package::declarationOfAnObjectIndirectionsLevelQuery() and - queryId = - // `@id` for the `declarationOfAnObjectIndirectionsLevel` query - "cpp/misra/declaration-of-an-object-indirections-level" and - ruleId = "RULE-11-3-2" and - category = "advisory" - or - query = - // `Query` instance for the `valueOfAnEnumerationConstantNotUnique` query - ImportMisra23Package::valueOfAnEnumerationConstantNotUniqueQuery() and - queryId = - // `@id` for the `valueOfAnEnumerationConstantNotUnique` query - "cpp/misra/value-of-an-enumeration-constant-not-unique" and - ruleId = "RULE-11-6-3" and - category = "required" - or - query = - // `Query` instance for the `bitFieldShallHaveAnAppropriateType` query - ImportMisra23Package::bitFieldShallHaveAnAppropriateTypeQuery() and - queryId = - // `@id` for the `bitFieldShallHaveAnAppropriateType` query - "cpp/misra/bit-field-shall-have-an-appropriate-type" and - ruleId = "RULE-12-2-2" and - category = "required" - or - query = - // `Query` instance for the `signedIntegerBitFieldHaveALengthOfOneBit` query - ImportMisra23Package::signedIntegerBitFieldHaveALengthOfOneBitQuery() and - queryId = - // `@id` for the `signedIntegerBitFieldHaveALengthOfOneBit` query - "cpp/misra/signed-integer-bit-field-have-a-length-of-one-bit" and - ruleId = "RULE-12-2-3" and - category = "required" - or - query = - // `Query` instance for the `virtualAndNonVirtualBaseClassInHierarchy` query - ImportMisra23Package::virtualAndNonVirtualBaseClassInHierarchyQuery() and - queryId = - // `@id` for the `virtualAndNonVirtualBaseClassInHierarchy` query - "cpp/misra/virtual-and-non-virtual-base-class-in-hierarchy" and - ruleId = "RULE-13-1-2" and - category = "required" - or - query = - // `Query` instance for the `differentDefaultArgsInOverridingVirtualFunction` query - ImportMisra23Package::differentDefaultArgsInOverridingVirtualFunctionQuery() and - queryId = - // `@id` for the `differentDefaultArgsInOverridingVirtualFunction` query - "cpp/misra/different-default-args-in-overriding-virtual-function" and - ruleId = "RULE-13-3-2" and - category = "required" - or - query = - // `Query` instance for the `declarationsOrOverridesParamsAreUnnamedOrIdentical` query - ImportMisra23Package::declarationsOrOverridesParamsAreUnnamedOrIdenticalQuery() and - queryId = - // `@id` for the `declarationsOrOverridesParamsAreUnnamedOrIdentical` query - "cpp/misra/declarations-or-overrides-params-are-unnamed-or-identical" and - ruleId = "RULE-13-3-3" and - category = "required" - or - query = - // `Query` instance for the `comparisonOfVirtualPointerOnlyBeWithNullptr` query - ImportMisra23Package::comparisonOfVirtualPointerOnlyBeWithNullptrQuery() and - queryId = - // `@id` for the `comparisonOfVirtualPointerOnlyBeWithNullptr` query - "cpp/misra/comparison-of-virtual-pointer-only-be-with-nullptr" and - ruleId = "RULE-13-3-4" and - category = "required" - or - query = - // `Query` instance for the `dynamicTypeUsedWithinConstructorOrDestructor` query - ImportMisra23Package::dynamicTypeUsedWithinConstructorOrDestructorQuery() and - queryId = - // `@id` for the `dynamicTypeUsedWithinConstructorOrDestructor` query - "cpp/misra/dynamic-type-used-within-constructor-or-destructor" and - ruleId = "RULE-15-1-1" and - category = "required" - or - query = - // `Query` instance for the `constructorsShouldInitializeAllBaseClasses` query - ImportMisra23Package::constructorsShouldInitializeAllBaseClassesQuery() and - queryId = - // `@id` for the `constructorsShouldInitializeAllBaseClasses` query - "cpp/misra/constructors-should-initialize-all-base-classes" and - ruleId = "RULE-15-1-2" and - category = "advisory" - or - query = - // `Query` instance for the `initializerListConstructorIsTheOnlyConstructor` query - ImportMisra23Package::initializerListConstructorIsTheOnlyConstructorQuery() and - queryId = - // `@id` for the `initializerListConstructorIsTheOnlyConstructor` query - "cpp/misra/initializer-list-constructor-is-the-only-constructor" and - ruleId = "RULE-15-1-5" and - category = "required" - or - query = - // `Query` instance for the `addressOfOperatorOverloaded` query - ImportMisra23Package::addressOfOperatorOverloadedQuery() and - queryId = - // `@id` for the `addressOfOperatorOverloaded` query - "cpp/misra/address-of-operator-overloaded" and - ruleId = "RULE-16-5-2" and - category = "required" - or - query = - // `Query` instance for the `functionTemplatesExplicitlySpecialized` query - ImportMisra23Package::functionTemplatesExplicitlySpecializedQuery() and - queryId = - // `@id` for the `functionTemplatesExplicitlySpecialized` query - "cpp/misra/function-templates-explicitly-specialized" and - ruleId = "RULE-17-8-1" and - category = "required" - or - query = - // `Query` instance for the `exceptionObjectHavePointerType` query - ImportMisra23Package::exceptionObjectHavePointerTypeQuery() and - queryId = - // `@id` for the `exceptionObjectHavePointerType` query - "cpp/misra/exception-object-have-pointer-type" and - ruleId = "RULE-18-1-1" and - category = "required" - or - query = - // `Query` instance for the `emptyThrowShallOnlyOccurWithinACatchHandler` query - ImportMisra23Package::emptyThrowShallOnlyOccurWithinACatchHandlerQuery() and - queryId = - // `@id` for the `emptyThrowShallOnlyOccurWithinACatchHandler` query - "cpp/misra/empty-throw-shall-only-occur-within-a-catch-handler" and - ruleId = "RULE-18-1-2" and - category = "required" - or - query = - // `Query` instance for the `handlersReferToNonStaticMembersFromTheirClass` query - ImportMisra23Package::handlersReferToNonStaticMembersFromTheirClassQuery() and - queryId = - // `@id` for the `handlersReferToNonStaticMembersFromTheirClass` query - "cpp/misra/handlers-refer-to-non-static-members-from-their-class" and - ruleId = "RULE-18-3-3" and - category = "required" - or - query = - // `Query` instance for the `noexceptFunctionShouldNotPropagateAnException` query - ImportMisra23Package::noexceptFunctionShouldNotPropagateAnExceptionQuery() and - queryId = - // `@id` for the `noexceptFunctionShouldNotPropagateAnException` query - "cpp/misra/noexcept-function-should-not-propagate-an-exception" and - ruleId = "RULE-18-5-1" and - category = "advisory" - or - query = - // `Query` instance for the `functionLikeMacrosDefined` query - ImportMisra23Package::functionLikeMacrosDefinedQuery() and - queryId = - // `@id` for the `functionLikeMacrosDefined` query - "cpp/misra/function-like-macros-defined" and - ruleId = "RULE-19-0-2" and - category = "required" - or - query = - // `Query` instance for the `includeDirectivesPrecededByPreprocessorDirectives` query - ImportMisra23Package::includeDirectivesPrecededByPreprocessorDirectivesQuery() and - queryId = - // `@id` for the `includeDirectivesPrecededByPreprocessorDirectives` query - "cpp/misra/include-directives-preceded-by-preprocessor-directives" and - ruleId = "RULE-19-0-3" and - category = "advisory" - or - query = - // `Query` instance for the `identifiersUsedInTheControllingExpressionOf` query - ImportMisra23Package::identifiersUsedInTheControllingExpressionOfQuery() and - queryId = - // `@id` for the `identifiersUsedInTheControllingExpressionOf` query - "cpp/misra/identifiers-used-in-the-controlling-expression-of" and - ruleId = "RULE-19-1-3" and - category = "required" - or - query = - // `Query` instance for the `charsThatShouldNotOccurInHeaderFileName` query - ImportMisra23Package::charsThatShouldNotOccurInHeaderFileNameQuery() and - queryId = - // `@id` for the `charsThatShouldNotOccurInHeaderFileName` query - "cpp/misra/chars-that-should-not-occur-in-header-file-name" and - ruleId = "RULE-19-2-3" and - category = "required" - or - query = - // `Query` instance for the `andPreprocessorOperatorsShouldNotBeUsed` query - ImportMisra23Package::andPreprocessorOperatorsShouldNotBeUsedQuery() and - queryId = - // `@id` for the `andPreprocessorOperatorsShouldNotBeUsed` query - "cpp/misra/and-preprocessor-operators-should-not-be-used" and - ruleId = "RULE-19-3-1" and - category = "advisory" - or - query = - // `Query` instance for the `macroParameterFollowingAHashOperator` query - ImportMisra23Package::macroParameterFollowingAHashOperatorQuery() and - queryId = - // `@id` for the `macroParameterFollowingAHashOperator` query - "cpp/misra/macro-parameter-following-a-hash-operator" and - ruleId = "RULE-19-3-2" and - category = "required" - or - query = - // `Query` instance for the `argumentToAMixedUseMacroShoulNotNeedExpansion` query - ImportMisra23Package::argumentToAMixedUseMacroShoulNotNeedExpansionQuery() and - queryId = - // `@id` for the `argumentToAMixedUseMacroShoulNotNeedExpansion` query - "cpp/misra/argument-to-a-mixed-use-macro-shoul-not-need-expansion" and - ruleId = "RULE-19-3-3" and - category = "required" - or - query = - // `Query` instance for the `tokensThatLookLikeDirectivesInAMacroArgument` query - ImportMisra23Package::tokensThatLookLikeDirectivesInAMacroArgumentQuery() and - queryId = - // `@id` for the `tokensThatLookLikeDirectivesInAMacroArgument` query - "cpp/misra/tokens-that-look-like-directives-in-a-macro-argument" and - ruleId = "RULE-19-3-5" and - category = "required" - or - query = - // `Query` instance for the `facilitiesProvidedByCsignalUsed` query - ImportMisra23Package::facilitiesProvidedByCsignalUsedQuery() and - queryId = - // `@id` for the `facilitiesProvidedByCsignalUsed` query - "cpp/misra/facilities-provided-by-csignal-used" and - ruleId = "RULE-21-10-3" and - category = "required" - or - query = - // `Query` instance for the `atofAtoiAtolAndAtollFromCstdlibUsed` query - ImportMisra23Package::atofAtoiAtolAndAtollFromCstdlibUsedQuery() and - queryId = - // `@id` for the `atofAtoiAtolAndAtollFromCstdlibUsed` query - "cpp/misra/atof-atoi-atol-and-atoll-from-cstdlib-used" and - ruleId = "RULE-21-2-1" and - category = "required" - or - query = - // `Query` instance for the `macroOffsetShouldNotBeUsed` query - ImportMisra23Package::macroOffsetShouldNotBeUsedQuery() and - queryId = - // `@id` for the `macroOffsetShouldNotBeUsed` query - "cpp/misra/macro-offset-should-not-be-used" and - ruleId = "RULE-21-2-4" and - category = "required" - or - query = - // `Query` instance for the `defineBothSizedAndUnsizedVersionOfAGlobalOperator` query - ImportMisra23Package::defineBothSizedAndUnsizedVersionOfAGlobalOperatorQuery() and - queryId = - // `@id` for the `defineBothSizedAndUnsizedVersionOfAGlobalOperator` query - "cpp/misra/define-both-sized-and-unsized-version-of-a-global-operator" and - ruleId = "RULE-21-6-4" and - category = "required" - or - query = - // `Query` instance for the `pointerToAnIncompleteClassTypeDeleted` query - ImportMisra23Package::pointerToAnIncompleteClassTypeDeletedQuery() and - queryId = - // `@id` for the `pointerToAnIncompleteClassTypeDeleted` query - "cpp/misra/pointer-to-an-incomplete-class-type-deleted" and - ruleId = "RULE-21-6-5" and - category = "required" - or - query = - // `Query` instance for the `pointersReturnedByLocaleFunctionsMustBeUsedAsConst` query - ImportMisra23Package::pointersReturnedByLocaleFunctionsMustBeUsedAsConstQuery() and - queryId = - // `@id` for the `pointersReturnedByLocaleFunctionsMustBeUsedAsConst` query - "cpp/misra/pointers-returned-by-locale-functions-must-be-used-as-const" and - ruleId = "RULE-25-5-2" and - category = "mandatory" - or - query = - // `Query` instance for the `callToSetlocaleInvalidatesOldPointersMisra` query - ImportMisra23Package::callToSetlocaleInvalidatesOldPointersMisraQuery() and - queryId = - // `@id` for the `callToSetlocaleInvalidatesOldPointersMisra` query - "cpp/misra/call-to-setlocale-invalidates-old-pointers-misra" and - ruleId = "RULE-25-5-3" and - category = "mandatory" - or - query = - // `Query` instance for the `callToSetlocaleInvalidatesOldPointersWarnMisra` query - ImportMisra23Package::callToSetlocaleInvalidatesOldPointersWarnMisraQuery() and - queryId = - // `@id` for the `callToSetlocaleInvalidatesOldPointersWarnMisra` query - "cpp/misra/call-to-setlocale-invalidates-old-pointers-warn-misra" and - ruleId = "RULE-25-5-3" and - category = "mandatory" - or - query = - // `Query` instance for the `vectorShouldNotBeSpecializedWithBool` query - ImportMisra23Package::vectorShouldNotBeSpecializedWithBoolQuery() and - queryId = - // `@id` for the `vectorShouldNotBeSpecializedWithBool` query - "cpp/misra/vector-should-not-be-specialized-with-bool" and - ruleId = "RULE-26-3-1" and - category = "advisory" - or - query = - // `Query` instance for the `forwardingReferencesAndForwardNotUsedTogether` query - ImportMisra23Package::forwardingReferencesAndForwardNotUsedTogetherQuery() and - queryId = - // `@id` for the `forwardingReferencesAndForwardNotUsedTogether` query - "cpp/misra/forwarding-references-and-forward-not-used-together" and - ruleId = "RULE-28-6-2" and - category = "required" - or - query = - // `Query` instance for the `objectUsedWhileInPotentiallyMovedFromState` query - ImportMisra23Package::objectUsedWhileInPotentiallyMovedFromStateQuery() and - queryId = - // `@id` for the `objectUsedWhileInPotentiallyMovedFromState` query - "cpp/misra/object-used-while-in-potentially-moved-from-state" and - ruleId = "RULE-28-6-3" and - category = "required" - or - query = - // `Query` instance for the `cLibraryInputoutputFunctionsUsed` query - ImportMisra23Package::cLibraryInputoutputFunctionsUsedQuery() and - queryId = - // `@id` for the `cLibraryInputoutputFunctionsUsed` query - "cpp/misra/c-library-inputoutput-functions-used" and - ruleId = "RULE-30-0-1" and - category = "required" - or - query = - // `Query` instance for the `readsAndWritesOnStreamNotSeparatedByPositioning` query - ImportMisra23Package::readsAndWritesOnStreamNotSeparatedByPositioningQuery() and - queryId = - // `@id` for the `readsAndWritesOnStreamNotSeparatedByPositioning` query - "cpp/misra/reads-and-writes-on-stream-not-separated-by-positioning" and - ruleId = "RULE-30-0-2" and - category = "required" - or - query = - // `Query` instance for the `operationsOnMemoryNotSequencedAppropriately` query - ImportMisra23Package::operationsOnMemoryNotSequencedAppropriatelyQuery() and - queryId = - // `@id` for the `operationsOnMemoryNotSequencedAppropriately` query - "cpp/misra/operations-on-memory-not-sequenced-appropriately" and - ruleId = "RULE-4-6-1" and - category = "required" - or - query = - // `Query` instance for the `characterOnlyInEscapeSequenceOrUniversalCharName` query - ImportMisra23Package::characterOnlyInEscapeSequenceOrUniversalCharNameQuery() and - queryId = - // `@id` for the `characterOnlyInEscapeSequenceOrUniversalCharName` query - "cpp/misra/character-only-in-escape-sequence-or-universal-char-name" and - ruleId = "RULE-5-13-1" and - category = "required" - or - query = - // `Query` instance for the `escapeSequencesAndUniversalCharNamesNotTerminated` query - ImportMisra23Package::escapeSequencesAndUniversalCharNamesNotTerminatedQuery() and - queryId = - // `@id` for the `escapeSequencesAndUniversalCharNamesNotTerminated` query - "cpp/misra/escape-sequences-and-universal-char-names-not-terminated" and - ruleId = "RULE-5-13-2" and - category = "required" - or - query = - // `Query` instance for the `octalConstantsUsed` query - ImportMisra23Package::octalConstantsUsedQuery() and - queryId = - // `@id` for the `octalConstantsUsed` query - "cpp/misra/octal-constants-used" and - ruleId = "RULE-5-13-3" and - category = "required" - or - query = - // `Query` instance for the `unsignedIntegerLiteralsNotAppropriatelySuffixed` query - ImportMisra23Package::unsignedIntegerLiteralsNotAppropriatelySuffixedQuery() and - queryId = - // `@id` for the `unsignedIntegerLiteralsNotAppropriatelySuffixed` query - "cpp/misra/unsigned-integer-literals-not-appropriately-suffixed" and - ruleId = "RULE-5-13-4" and - category = "required" - or - query = - // `Query` instance for the `lowercaseLUsedAsFirstCharacterInLiteralSuffix` query - ImportMisra23Package::lowercaseLUsedAsFirstCharacterInLiteralSuffixQuery() and - queryId = - // `@id` for the `lowercaseLUsedAsFirstCharacterInLiteralSuffix` query - "cpp/misra/lowercase-l-used-as-first-character-in-literal-suffix" and - ruleId = "RULE-5-13-5" and - category = "required" - or - query = - // `Query` instance for the `characterSequenceUsedWithinACStyleComment` query - ImportMisra23Package::characterSequenceUsedWithinACStyleCommentQuery() and - queryId = - // `@id` for the `characterSequenceUsedWithinACStyleComment` query - "cpp/misra/character-sequence-used-within-ac-style-comment" and - ruleId = "RULE-5-7-1" and - category = "required" - or - query = - // `Query` instance for the `lineSplicingUsedInComments` query - ImportMisra23Package::lineSplicingUsedInCommentsQuery() and - queryId = - // `@id` for the `lineSplicingUsedInComments` query - "cpp/misra/line-splicing-used-in-comments" and - ruleId = "RULE-5-7-3" and - category = "required" - or - query = - // `Query` instance for the `globalDeclarationsOnlyMainNamespaceOrExternC` query - ImportMisra23Package::globalDeclarationsOnlyMainNamespaceOrExternCQuery() and - queryId = - // `@id` for the `globalDeclarationsOnlyMainNamespaceOrExternC` query - "cpp/misra/global-declarations-only-main-namespace-or-extern-c" and - ruleId = "RULE-6-0-3" and - category = "advisory" - or - query = - // `Query` instance for the `mainUsedOnlyForTheGlobalFunctionMain` query - ImportMisra23Package::mainUsedOnlyForTheGlobalFunctionMainQuery() and - queryId = - // `@id` for the `mainUsedOnlyForTheGlobalFunctionMain` query - "cpp/misra/main-used-only-for-the-global-function-main" and - ruleId = "RULE-6-0-4" and - category = "required" - or - query = - // `Query` instance for the `oneDefinitionRuleViolated` query - ImportMisra23Package::oneDefinitionRuleViolatedQuery() and - queryId = - // `@id` for the `oneDefinitionRuleViolated` query - "cpp/misra/one-definition-rule-violated" and - ruleId = "RULE-6-2-1" and - category = "required" - or - query = - // `Query` instance for the `variableDeclaredInInnerScopeHidesOuterScope` query - ImportMisra23Package::variableDeclaredInInnerScopeHidesOuterScopeQuery() and - queryId = - // `@id` for the `variableDeclaredInInnerScopeHidesOuterScope` query - "cpp/misra/variable-declared-in-inner-scope-hides-outer-scope" and - ruleId = "RULE-6-4-1" and - category = "required" - or - query = - // `Query` instance for the `derivedClasseConcealFunctionInheritedFromTheBase` query - ImportMisra23Package::derivedClasseConcealFunctionInheritedFromTheBaseQuery() and - queryId = - // `@id` for the `derivedClasseConcealFunctionInheritedFromTheBase` query - "cpp/misra/derived-classe-conceal-function-inherited-from-the-base" and - ruleId = "RULE-6-4-2" and - category = "required" - or - query = - // `Query` instance for the `nameInDependentBaseResolvedByUnqualifiedLookup` query - ImportMisra23Package::nameInDependentBaseResolvedByUnqualifiedLookupQuery() and - queryId = - // `@id` for the `nameInDependentBaseResolvedByUnqualifiedLookup` query - "cpp/misra/name-in-dependent-base-resolved-by-unqualified-lookup" and - ruleId = "RULE-6-4-3" and - category = "required" - or - query = - // `Query` instance for the `objectAccessedBeforeLifetimeMisra` query - ImportMisra23Package::objectAccessedBeforeLifetimeMisraQuery() and - queryId = - // `@id` for the `objectAccessedBeforeLifetimeMisra` query - "cpp/misra/object-accessed-before-lifetime-misra" and - ruleId = "RULE-6-8-1" and - category = "required" - or - query = - // `Query` instance for the `objectAccessedAfterLifetimeMisra` query - ImportMisra23Package::objectAccessedAfterLifetimeMisraQuery() and - queryId = - // `@id` for the `objectAccessedAfterLifetimeMisra` query - "cpp/misra/object-accessed-after-lifetime-misra" and - ruleId = "RULE-6-8-1" and - category = "required" - or - query = - // `Query` instance for the `mustNotReturnReferenceToLocalAutomaticVariable` query - ImportMisra23Package::mustNotReturnReferenceToLocalAutomaticVariableQuery() and - queryId = - // `@id` for the `mustNotReturnReferenceToLocalAutomaticVariable` query - "cpp/misra/must-not-return-reference-to-local-automatic-variable" and - ruleId = "RULE-6-8-2" and - category = "mandatory" - or - query = - // `Query` instance for the `nullptrNotTheOnlyFormOfTheNullPointerConstant` query - ImportMisra23Package::nullptrNotTheOnlyFormOfTheNullPointerConstantQuery() and - queryId = - // `@id` for the `nullptrNotTheOnlyFormOfTheNullPointerConstant` query - "cpp/misra/nullptr-not-the-only-form-of-the-null-pointer-constant" and - ruleId = "RULE-7-11-1" and - category = "required" - or - query = - // `Query` instance for the `arrayPassedAsFunctionArgumentDecayToAPointer` query - ImportMisra23Package::arrayPassedAsFunctionArgumentDecayToAPointerQuery() and - queryId = - // `@id` for the `arrayPassedAsFunctionArgumentDecayToAPointer` query - "cpp/misra/array-passed-as-function-argument-decay-to-a-pointer" and - ruleId = "RULE-7-11-2" and - category = "required" - or - query = - // `Query` instance for the `resultOfAnAssignmentOperatorShouldNotBeUsed` query - ImportMisra23Package::resultOfAnAssignmentOperatorShouldNotBeUsedQuery() and - queryId = - // `@id` for the `resultOfAnAssignmentOperatorShouldNotBeUsed` query - "cpp/misra/result-of-an-assignment-operator-should-not-be-used" and - ruleId = "RULE-8-18-2" and - category = "advisory" - or - query = - // `Query` instance for the `commaOperatorShouldNotBeUsed` query - ImportMisra23Package::commaOperatorShouldNotBeUsedQuery() and - queryId = - // `@id` for the `commaOperatorShouldNotBeUsed` query - "cpp/misra/comma-operator-should-not-be-used" and - ruleId = "RULE-8-19-1" and - category = "advisory" - or - query = - // `Query` instance for the `functionsCallThemselvesEitherDirectlyOrIndirectly` query - ImportMisra23Package::functionsCallThemselvesEitherDirectlyOrIndirectlyQuery() and - queryId = - // `@id` for the `functionsCallThemselvesEitherDirectlyOrIndirectly` query - "cpp/misra/functions-call-themselves-either-directly-or-indirectly" and - ruleId = "RULE-8-2-10" and - category = "required" - or - query = - // `Query` instance for the `castRemovesConstOrVolatileFromPointerOrReference` query - ImportMisra23Package::castRemovesConstOrVolatileFromPointerOrReferenceQuery() and - queryId = - // `@id` for the `castRemovesConstOrVolatileFromPointerOrReference` query - "cpp/misra/cast-removes-const-or-volatile-from-pointer-or-reference" and - ruleId = "RULE-8-2-3" and - category = "required" - or - query = - // `Query` instance for the `castsBetweenAPointerToFunctionAndAnyOtherType` query - ImportMisra23Package::castsBetweenAPointerToFunctionAndAnyOtherTypeQuery() and - queryId = - // `@id` for the `castsBetweenAPointerToFunctionAndAnyOtherType` query - "cpp/misra/casts-between-a-pointer-to-function-and-any-other-type" and - ruleId = "RULE-8-2-4" and - category = "required" - or - query = - // `Query` instance for the `reinterpretCastShallNotBeUsed` query - ImportMisra23Package::reinterpretCastShallNotBeUsedQuery() and - queryId = - // `@id` for the `reinterpretCastShallNotBeUsed` query - "cpp/misra/reinterpret-cast-shall-not-be-used" and - ruleId = "RULE-8-2-5" and - category = "required" - or - query = - // `Query` instance for the `unsignedOperationWithConstantOperandsShouldNotWrap` query - ImportMisra23Package::unsignedOperationWithConstantOperandsShouldNotWrapQuery() and - queryId = - // `@id` for the `unsignedOperationWithConstantOperandsShouldNotWrap` query - "cpp/misra/unsigned-operation-with-constant-operands-should-not-wrap" and - ruleId = "RULE-8-20-1" and - category = "advisory" - or - query = - // `Query` instance for the `builtInOperatorAppliedToUnsignedExpression` query - ImportMisra23Package::builtInOperatorAppliedToUnsignedExpressionQuery() and - queryId = - // `@id` for the `builtInOperatorAppliedToUnsignedExpression` query - "cpp/misra/built-in-operator-applied-to-unsigned-expression" and - ruleId = "RULE-8-3-1" and - category = "advisory" - or - query = - // `Query` instance for the `bodyOfIterationOrSelectionStatementNotCompound` query - ImportMisra23Package::bodyOfIterationOrSelectionStatementNotCompoundQuery() and - queryId = - // `@id` for the `bodyOfIterationOrSelectionStatementNotCompound` query - "cpp/misra/body-of-iteration-or-selection-statement-not-compound" and - ruleId = "RULE-9-3-1" and - category = "required" - or - query = - // `Query` instance for the `ifElseIfEndCondition` query - ImportMisra23Package::ifElseIfEndConditionQuery() and - queryId = - // `@id` for the `ifElseIfEndCondition` query - "cpp/misra/if-else-if-end-condition" and - ruleId = "RULE-9-4-1" and - category = "required" - or - query = - // `Query` instance for the `gotoStatementShouldNotBeUsed` query - ImportMisra23Package::gotoStatementShouldNotBeUsedQuery() and - queryId = - // `@id` for the `gotoStatementShouldNotBeUsed` query - "cpp/misra/goto-statement-should-not-be-used" and - ruleId = "RULE-9-6-1" and - category = "advisory" - or - query = - // `Query` instance for the `gotoShallReferenceALabelInSurroundingBlock` query - ImportMisra23Package::gotoShallReferenceALabelInSurroundingBlockQuery() and - queryId = - // `@id` for the `gotoShallReferenceALabelInSurroundingBlock` query - "cpp/misra/goto-shall-reference-a-label-in-surrounding-block" and - ruleId = "RULE-9-6-2" and - category = "required" - or - query = - // `Query` instance for the `gotoShallJumpToLabelDeclaredLaterInTheFunction` query - ImportMisra23Package::gotoShallJumpToLabelDeclaredLaterInTheFunctionQuery() and - queryId = - // `@id` for the `gotoShallJumpToLabelDeclaredLaterInTheFunction` query - "cpp/misra/goto-shall-jump-to-label-declared-later-in-the-function" and - ruleId = "RULE-9-6-3" and - category = "required" - or - query = - // `Query` instance for the `functionDeclaredWithTheNoreturnAttributeReturn` query - ImportMisra23Package::functionDeclaredWithTheNoreturnAttributeReturnQuery() and - queryId = - // `@id` for the `functionDeclaredWithTheNoreturnAttributeReturn` query - "cpp/misra/function-declared-with-the-noreturn-attribute-return" and - ruleId = "RULE-9-6-4" and - category = "required" - or - query = - // `Query` instance for the `nonVoidFunctionShallReturnAValueOnAllPaths` query - ImportMisra23Package::nonVoidFunctionShallReturnAValueOnAllPathsQuery() and - queryId = - // `@id` for the `nonVoidFunctionShallReturnAValueOnAllPaths` query - "cpp/misra/non-void-function-shall-return-a-value-on-all-paths" and - ruleId = "RULE-9-6-5" and - category = "required" -} - -module ImportMisra23Package { - Query userCopyAndMoveAssignmentShallHandleSelfAssignmentQuery() { - //autogenerate `Query` type - result = - // `Query` type for `userCopyAndMoveAssignmentShallHandleSelfAssignment` query - TQueryCPP(TImportMisra23PackageQuery(TUserCopyAndMoveAssignmentShallHandleSelfAssignmentQuery())) - } - - Query sectionsOfCodeShouldNotBeCommentedOutQuery() { - //autogenerate `Query` type - result = - // `Query` type for `sectionsOfCodeShouldNotBeCommentedOut` query - TQueryCPP(TImportMisra23PackageQuery(TSectionsOfCodeShouldNotBeCommentedOutQuery())) - } - - Query declarationShouldNotDeclareMoreThanOneVariableQuery() { - //autogenerate `Query` type - result = - // `Query` type for `declarationShouldNotDeclareMoreThanOneVariable` query - TQueryCPP(TImportMisra23PackageQuery(TDeclarationShouldNotDeclareMoreThanOneVariableQuery())) - } - - Query enumerationNotDefinedWithAnExplicitUnderlyingTypeQuery() { - //autogenerate `Query` type - result = - // `Query` type for `enumerationNotDefinedWithAnExplicitUnderlyingType` query - TQueryCPP(TImportMisra23PackageQuery(TEnumerationNotDefinedWithAnExplicitUnderlyingTypeQuery())) - } - - Query asmDeclarationShallNotBeUsedQuery() { - //autogenerate `Query` type - result = - // `Query` type for `asmDeclarationShallNotBeUsed` query - TQueryCPP(TImportMisra23PackageQuery(TAsmDeclarationShallNotBeUsedQuery())) - } - - Query declarationOfAnObjectIndirectionsLevelQuery() { - //autogenerate `Query` type - result = - // `Query` type for `declarationOfAnObjectIndirectionsLevel` query - TQueryCPP(TImportMisra23PackageQuery(TDeclarationOfAnObjectIndirectionsLevelQuery())) - } - - Query valueOfAnEnumerationConstantNotUniqueQuery() { - //autogenerate `Query` type - result = - // `Query` type for `valueOfAnEnumerationConstantNotUnique` query - TQueryCPP(TImportMisra23PackageQuery(TValueOfAnEnumerationConstantNotUniqueQuery())) - } - - Query bitFieldShallHaveAnAppropriateTypeQuery() { - //autogenerate `Query` type - result = - // `Query` type for `bitFieldShallHaveAnAppropriateType` query - TQueryCPP(TImportMisra23PackageQuery(TBitFieldShallHaveAnAppropriateTypeQuery())) - } - - Query signedIntegerBitFieldHaveALengthOfOneBitQuery() { - //autogenerate `Query` type - result = - // `Query` type for `signedIntegerBitFieldHaveALengthOfOneBit` query - TQueryCPP(TImportMisra23PackageQuery(TSignedIntegerBitFieldHaveALengthOfOneBitQuery())) - } - - Query virtualAndNonVirtualBaseClassInHierarchyQuery() { - //autogenerate `Query` type - result = - // `Query` type for `virtualAndNonVirtualBaseClassInHierarchy` query - TQueryCPP(TImportMisra23PackageQuery(TVirtualAndNonVirtualBaseClassInHierarchyQuery())) - } - - Query differentDefaultArgsInOverridingVirtualFunctionQuery() { - //autogenerate `Query` type - result = - // `Query` type for `differentDefaultArgsInOverridingVirtualFunction` query - TQueryCPP(TImportMisra23PackageQuery(TDifferentDefaultArgsInOverridingVirtualFunctionQuery())) - } - - Query declarationsOrOverridesParamsAreUnnamedOrIdenticalQuery() { - //autogenerate `Query` type - result = - // `Query` type for `declarationsOrOverridesParamsAreUnnamedOrIdentical` query - TQueryCPP(TImportMisra23PackageQuery(TDeclarationsOrOverridesParamsAreUnnamedOrIdenticalQuery())) - } - - Query comparisonOfVirtualPointerOnlyBeWithNullptrQuery() { - //autogenerate `Query` type - result = - // `Query` type for `comparisonOfVirtualPointerOnlyBeWithNullptr` query - TQueryCPP(TImportMisra23PackageQuery(TComparisonOfVirtualPointerOnlyBeWithNullptrQuery())) - } - - Query dynamicTypeUsedWithinConstructorOrDestructorQuery() { - //autogenerate `Query` type - result = - // `Query` type for `dynamicTypeUsedWithinConstructorOrDestructor` query - TQueryCPP(TImportMisra23PackageQuery(TDynamicTypeUsedWithinConstructorOrDestructorQuery())) - } - - Query constructorsShouldInitializeAllBaseClassesQuery() { - //autogenerate `Query` type - result = - // `Query` type for `constructorsShouldInitializeAllBaseClasses` query - TQueryCPP(TImportMisra23PackageQuery(TConstructorsShouldInitializeAllBaseClassesQuery())) - } - - Query initializerListConstructorIsTheOnlyConstructorQuery() { - //autogenerate `Query` type - result = - // `Query` type for `initializerListConstructorIsTheOnlyConstructor` query - TQueryCPP(TImportMisra23PackageQuery(TInitializerListConstructorIsTheOnlyConstructorQuery())) - } - - Query addressOfOperatorOverloadedQuery() { - //autogenerate `Query` type - result = - // `Query` type for `addressOfOperatorOverloaded` query - TQueryCPP(TImportMisra23PackageQuery(TAddressOfOperatorOverloadedQuery())) - } - - Query functionTemplatesExplicitlySpecializedQuery() { - //autogenerate `Query` type - result = - // `Query` type for `functionTemplatesExplicitlySpecialized` query - TQueryCPP(TImportMisra23PackageQuery(TFunctionTemplatesExplicitlySpecializedQuery())) - } - - Query exceptionObjectHavePointerTypeQuery() { - //autogenerate `Query` type - result = - // `Query` type for `exceptionObjectHavePointerType` query - TQueryCPP(TImportMisra23PackageQuery(TExceptionObjectHavePointerTypeQuery())) - } - - Query emptyThrowShallOnlyOccurWithinACatchHandlerQuery() { - //autogenerate `Query` type - result = - // `Query` type for `emptyThrowShallOnlyOccurWithinACatchHandler` query - TQueryCPP(TImportMisra23PackageQuery(TEmptyThrowShallOnlyOccurWithinACatchHandlerQuery())) - } - - Query handlersReferToNonStaticMembersFromTheirClassQuery() { - //autogenerate `Query` type - result = - // `Query` type for `handlersReferToNonStaticMembersFromTheirClass` query - TQueryCPP(TImportMisra23PackageQuery(THandlersReferToNonStaticMembersFromTheirClassQuery())) - } - - Query noexceptFunctionShouldNotPropagateAnExceptionQuery() { - //autogenerate `Query` type - result = - // `Query` type for `noexceptFunctionShouldNotPropagateAnException` query - TQueryCPP(TImportMisra23PackageQuery(TNoexceptFunctionShouldNotPropagateAnExceptionQuery())) - } - - Query functionLikeMacrosDefinedQuery() { - //autogenerate `Query` type - result = - // `Query` type for `functionLikeMacrosDefined` query - TQueryCPP(TImportMisra23PackageQuery(TFunctionLikeMacrosDefinedQuery())) - } - - Query includeDirectivesPrecededByPreprocessorDirectivesQuery() { - //autogenerate `Query` type - result = - // `Query` type for `includeDirectivesPrecededByPreprocessorDirectives` query - TQueryCPP(TImportMisra23PackageQuery(TIncludeDirectivesPrecededByPreprocessorDirectivesQuery())) - } - - Query identifiersUsedInTheControllingExpressionOfQuery() { - //autogenerate `Query` type - result = - // `Query` type for `identifiersUsedInTheControllingExpressionOf` query - TQueryCPP(TImportMisra23PackageQuery(TIdentifiersUsedInTheControllingExpressionOfQuery())) - } - - Query charsThatShouldNotOccurInHeaderFileNameQuery() { - //autogenerate `Query` type - result = - // `Query` type for `charsThatShouldNotOccurInHeaderFileName` query - TQueryCPP(TImportMisra23PackageQuery(TCharsThatShouldNotOccurInHeaderFileNameQuery())) - } - - Query andPreprocessorOperatorsShouldNotBeUsedQuery() { - //autogenerate `Query` type - result = - // `Query` type for `andPreprocessorOperatorsShouldNotBeUsed` query - TQueryCPP(TImportMisra23PackageQuery(TAndPreprocessorOperatorsShouldNotBeUsedQuery())) - } - - Query macroParameterFollowingAHashOperatorQuery() { - //autogenerate `Query` type - result = - // `Query` type for `macroParameterFollowingAHashOperator` query - TQueryCPP(TImportMisra23PackageQuery(TMacroParameterFollowingAHashOperatorQuery())) - } - - Query argumentToAMixedUseMacroShoulNotNeedExpansionQuery() { - //autogenerate `Query` type - result = - // `Query` type for `argumentToAMixedUseMacroShoulNotNeedExpansion` query - TQueryCPP(TImportMisra23PackageQuery(TArgumentToAMixedUseMacroShoulNotNeedExpansionQuery())) - } - - Query tokensThatLookLikeDirectivesInAMacroArgumentQuery() { - //autogenerate `Query` type - result = - // `Query` type for `tokensThatLookLikeDirectivesInAMacroArgument` query - TQueryCPP(TImportMisra23PackageQuery(TTokensThatLookLikeDirectivesInAMacroArgumentQuery())) - } - - Query facilitiesProvidedByCsignalUsedQuery() { - //autogenerate `Query` type - result = - // `Query` type for `facilitiesProvidedByCsignalUsed` query - TQueryCPP(TImportMisra23PackageQuery(TFacilitiesProvidedByCsignalUsedQuery())) - } - - Query atofAtoiAtolAndAtollFromCstdlibUsedQuery() { - //autogenerate `Query` type - result = - // `Query` type for `atofAtoiAtolAndAtollFromCstdlibUsed` query - TQueryCPP(TImportMisra23PackageQuery(TAtofAtoiAtolAndAtollFromCstdlibUsedQuery())) - } - - Query macroOffsetShouldNotBeUsedQuery() { - //autogenerate `Query` type - result = - // `Query` type for `macroOffsetShouldNotBeUsed` query - TQueryCPP(TImportMisra23PackageQuery(TMacroOffsetShouldNotBeUsedQuery())) - } - - Query defineBothSizedAndUnsizedVersionOfAGlobalOperatorQuery() { - //autogenerate `Query` type - result = - // `Query` type for `defineBothSizedAndUnsizedVersionOfAGlobalOperator` query - TQueryCPP(TImportMisra23PackageQuery(TDefineBothSizedAndUnsizedVersionOfAGlobalOperatorQuery())) - } - - Query pointerToAnIncompleteClassTypeDeletedQuery() { - //autogenerate `Query` type - result = - // `Query` type for `pointerToAnIncompleteClassTypeDeleted` query - TQueryCPP(TImportMisra23PackageQuery(TPointerToAnIncompleteClassTypeDeletedQuery())) - } - - Query pointersReturnedByLocaleFunctionsMustBeUsedAsConstQuery() { - //autogenerate `Query` type - result = - // `Query` type for `pointersReturnedByLocaleFunctionsMustBeUsedAsConst` query - TQueryCPP(TImportMisra23PackageQuery(TPointersReturnedByLocaleFunctionsMustBeUsedAsConstQuery())) - } - - Query callToSetlocaleInvalidatesOldPointersMisraQuery() { - //autogenerate `Query` type - result = - // `Query` type for `callToSetlocaleInvalidatesOldPointersMisra` query - TQueryCPP(TImportMisra23PackageQuery(TCallToSetlocaleInvalidatesOldPointersMisraQuery())) - } - - Query callToSetlocaleInvalidatesOldPointersWarnMisraQuery() { - //autogenerate `Query` type - result = - // `Query` type for `callToSetlocaleInvalidatesOldPointersWarnMisra` query - TQueryCPP(TImportMisra23PackageQuery(TCallToSetlocaleInvalidatesOldPointersWarnMisraQuery())) - } - - Query vectorShouldNotBeSpecializedWithBoolQuery() { - //autogenerate `Query` type - result = - // `Query` type for `vectorShouldNotBeSpecializedWithBool` query - TQueryCPP(TImportMisra23PackageQuery(TVectorShouldNotBeSpecializedWithBoolQuery())) - } - - Query forwardingReferencesAndForwardNotUsedTogetherQuery() { - //autogenerate `Query` type - result = - // `Query` type for `forwardingReferencesAndForwardNotUsedTogether` query - TQueryCPP(TImportMisra23PackageQuery(TForwardingReferencesAndForwardNotUsedTogetherQuery())) - } - - Query objectUsedWhileInPotentiallyMovedFromStateQuery() { - //autogenerate `Query` type - result = - // `Query` type for `objectUsedWhileInPotentiallyMovedFromState` query - TQueryCPP(TImportMisra23PackageQuery(TObjectUsedWhileInPotentiallyMovedFromStateQuery())) - } - - Query cLibraryInputoutputFunctionsUsedQuery() { - //autogenerate `Query` type - result = - // `Query` type for `cLibraryInputoutputFunctionsUsed` query - TQueryCPP(TImportMisra23PackageQuery(TCLibraryInputoutputFunctionsUsedQuery())) - } - - Query readsAndWritesOnStreamNotSeparatedByPositioningQuery() { - //autogenerate `Query` type - result = - // `Query` type for `readsAndWritesOnStreamNotSeparatedByPositioning` query - TQueryCPP(TImportMisra23PackageQuery(TReadsAndWritesOnStreamNotSeparatedByPositioningQuery())) - } - - Query operationsOnMemoryNotSequencedAppropriatelyQuery() { - //autogenerate `Query` type - result = - // `Query` type for `operationsOnMemoryNotSequencedAppropriately` query - TQueryCPP(TImportMisra23PackageQuery(TOperationsOnMemoryNotSequencedAppropriatelyQuery())) - } - - Query characterOnlyInEscapeSequenceOrUniversalCharNameQuery() { - //autogenerate `Query` type - result = - // `Query` type for `characterOnlyInEscapeSequenceOrUniversalCharName` query - TQueryCPP(TImportMisra23PackageQuery(TCharacterOnlyInEscapeSequenceOrUniversalCharNameQuery())) - } - - Query escapeSequencesAndUniversalCharNamesNotTerminatedQuery() { - //autogenerate `Query` type - result = - // `Query` type for `escapeSequencesAndUniversalCharNamesNotTerminated` query - TQueryCPP(TImportMisra23PackageQuery(TEscapeSequencesAndUniversalCharNamesNotTerminatedQuery())) - } - - Query octalConstantsUsedQuery() { - //autogenerate `Query` type - result = - // `Query` type for `octalConstantsUsed` query - TQueryCPP(TImportMisra23PackageQuery(TOctalConstantsUsedQuery())) - } - - Query unsignedIntegerLiteralsNotAppropriatelySuffixedQuery() { - //autogenerate `Query` type - result = - // `Query` type for `unsignedIntegerLiteralsNotAppropriatelySuffixed` query - TQueryCPP(TImportMisra23PackageQuery(TUnsignedIntegerLiteralsNotAppropriatelySuffixedQuery())) - } - - Query lowercaseLUsedAsFirstCharacterInLiteralSuffixQuery() { - //autogenerate `Query` type - result = - // `Query` type for `lowercaseLUsedAsFirstCharacterInLiteralSuffix` query - TQueryCPP(TImportMisra23PackageQuery(TLowercaseLUsedAsFirstCharacterInLiteralSuffixQuery())) - } - - Query characterSequenceUsedWithinACStyleCommentQuery() { - //autogenerate `Query` type - result = - // `Query` type for `characterSequenceUsedWithinACStyleComment` query - TQueryCPP(TImportMisra23PackageQuery(TCharacterSequenceUsedWithinACStyleCommentQuery())) - } - - Query lineSplicingUsedInCommentsQuery() { - //autogenerate `Query` type - result = - // `Query` type for `lineSplicingUsedInComments` query - TQueryCPP(TImportMisra23PackageQuery(TLineSplicingUsedInCommentsQuery())) - } - - Query globalDeclarationsOnlyMainNamespaceOrExternCQuery() { - //autogenerate `Query` type - result = - // `Query` type for `globalDeclarationsOnlyMainNamespaceOrExternC` query - TQueryCPP(TImportMisra23PackageQuery(TGlobalDeclarationsOnlyMainNamespaceOrExternCQuery())) - } - - Query mainUsedOnlyForTheGlobalFunctionMainQuery() { - //autogenerate `Query` type - result = - // `Query` type for `mainUsedOnlyForTheGlobalFunctionMain` query - TQueryCPP(TImportMisra23PackageQuery(TMainUsedOnlyForTheGlobalFunctionMainQuery())) - } - - Query oneDefinitionRuleViolatedQuery() { - //autogenerate `Query` type - result = - // `Query` type for `oneDefinitionRuleViolated` query - TQueryCPP(TImportMisra23PackageQuery(TOneDefinitionRuleViolatedQuery())) - } - - Query variableDeclaredInInnerScopeHidesOuterScopeQuery() { - //autogenerate `Query` type - result = - // `Query` type for `variableDeclaredInInnerScopeHidesOuterScope` query - TQueryCPP(TImportMisra23PackageQuery(TVariableDeclaredInInnerScopeHidesOuterScopeQuery())) - } - - Query derivedClasseConcealFunctionInheritedFromTheBaseQuery() { - //autogenerate `Query` type - result = - // `Query` type for `derivedClasseConcealFunctionInheritedFromTheBase` query - TQueryCPP(TImportMisra23PackageQuery(TDerivedClasseConcealFunctionInheritedFromTheBaseQuery())) - } - - Query nameInDependentBaseResolvedByUnqualifiedLookupQuery() { - //autogenerate `Query` type - result = - // `Query` type for `nameInDependentBaseResolvedByUnqualifiedLookup` query - TQueryCPP(TImportMisra23PackageQuery(TNameInDependentBaseResolvedByUnqualifiedLookupQuery())) - } - - Query objectAccessedBeforeLifetimeMisraQuery() { - //autogenerate `Query` type - result = - // `Query` type for `objectAccessedBeforeLifetimeMisra` query - TQueryCPP(TImportMisra23PackageQuery(TObjectAccessedBeforeLifetimeMisraQuery())) - } - - Query objectAccessedAfterLifetimeMisraQuery() { - //autogenerate `Query` type - result = - // `Query` type for `objectAccessedAfterLifetimeMisra` query - TQueryCPP(TImportMisra23PackageQuery(TObjectAccessedAfterLifetimeMisraQuery())) - } - - Query mustNotReturnReferenceToLocalAutomaticVariableQuery() { - //autogenerate `Query` type - result = - // `Query` type for `mustNotReturnReferenceToLocalAutomaticVariable` query - TQueryCPP(TImportMisra23PackageQuery(TMustNotReturnReferenceToLocalAutomaticVariableQuery())) - } - - Query nullptrNotTheOnlyFormOfTheNullPointerConstantQuery() { - //autogenerate `Query` type - result = - // `Query` type for `nullptrNotTheOnlyFormOfTheNullPointerConstant` query - TQueryCPP(TImportMisra23PackageQuery(TNullptrNotTheOnlyFormOfTheNullPointerConstantQuery())) - } - - Query arrayPassedAsFunctionArgumentDecayToAPointerQuery() { - //autogenerate `Query` type - result = - // `Query` type for `arrayPassedAsFunctionArgumentDecayToAPointer` query - TQueryCPP(TImportMisra23PackageQuery(TArrayPassedAsFunctionArgumentDecayToAPointerQuery())) - } - - Query resultOfAnAssignmentOperatorShouldNotBeUsedQuery() { - //autogenerate `Query` type - result = - // `Query` type for `resultOfAnAssignmentOperatorShouldNotBeUsed` query - TQueryCPP(TImportMisra23PackageQuery(TResultOfAnAssignmentOperatorShouldNotBeUsedQuery())) - } - - Query commaOperatorShouldNotBeUsedQuery() { - //autogenerate `Query` type - result = - // `Query` type for `commaOperatorShouldNotBeUsed` query - TQueryCPP(TImportMisra23PackageQuery(TCommaOperatorShouldNotBeUsedQuery())) - } - - Query functionsCallThemselvesEitherDirectlyOrIndirectlyQuery() { - //autogenerate `Query` type - result = - // `Query` type for `functionsCallThemselvesEitherDirectlyOrIndirectly` query - TQueryCPP(TImportMisra23PackageQuery(TFunctionsCallThemselvesEitherDirectlyOrIndirectlyQuery())) - } - - Query castRemovesConstOrVolatileFromPointerOrReferenceQuery() { - //autogenerate `Query` type - result = - // `Query` type for `castRemovesConstOrVolatileFromPointerOrReference` query - TQueryCPP(TImportMisra23PackageQuery(TCastRemovesConstOrVolatileFromPointerOrReferenceQuery())) - } - - Query castsBetweenAPointerToFunctionAndAnyOtherTypeQuery() { - //autogenerate `Query` type - result = - // `Query` type for `castsBetweenAPointerToFunctionAndAnyOtherType` query - TQueryCPP(TImportMisra23PackageQuery(TCastsBetweenAPointerToFunctionAndAnyOtherTypeQuery())) - } - - Query reinterpretCastShallNotBeUsedQuery() { - //autogenerate `Query` type - result = - // `Query` type for `reinterpretCastShallNotBeUsed` query - TQueryCPP(TImportMisra23PackageQuery(TReinterpretCastShallNotBeUsedQuery())) - } - - Query unsignedOperationWithConstantOperandsShouldNotWrapQuery() { - //autogenerate `Query` type - result = - // `Query` type for `unsignedOperationWithConstantOperandsShouldNotWrap` query - TQueryCPP(TImportMisra23PackageQuery(TUnsignedOperationWithConstantOperandsShouldNotWrapQuery())) - } - - Query builtInOperatorAppliedToUnsignedExpressionQuery() { - //autogenerate `Query` type - result = - // `Query` type for `builtInOperatorAppliedToUnsignedExpression` query - TQueryCPP(TImportMisra23PackageQuery(TBuiltInOperatorAppliedToUnsignedExpressionQuery())) - } - - Query bodyOfIterationOrSelectionStatementNotCompoundQuery() { - //autogenerate `Query` type - result = - // `Query` type for `bodyOfIterationOrSelectionStatementNotCompound` query - TQueryCPP(TImportMisra23PackageQuery(TBodyOfIterationOrSelectionStatementNotCompoundQuery())) - } - - Query ifElseIfEndConditionQuery() { - //autogenerate `Query` type - result = - // `Query` type for `ifElseIfEndCondition` query - TQueryCPP(TImportMisra23PackageQuery(TIfElseIfEndConditionQuery())) - } - - Query gotoStatementShouldNotBeUsedQuery() { - //autogenerate `Query` type - result = - // `Query` type for `gotoStatementShouldNotBeUsed` query - TQueryCPP(TImportMisra23PackageQuery(TGotoStatementShouldNotBeUsedQuery())) - } - - Query gotoShallReferenceALabelInSurroundingBlockQuery() { - //autogenerate `Query` type - result = - // `Query` type for `gotoShallReferenceALabelInSurroundingBlock` query - TQueryCPP(TImportMisra23PackageQuery(TGotoShallReferenceALabelInSurroundingBlockQuery())) - } - - Query gotoShallJumpToLabelDeclaredLaterInTheFunctionQuery() { - //autogenerate `Query` type - result = - // `Query` type for `gotoShallJumpToLabelDeclaredLaterInTheFunction` query - TQueryCPP(TImportMisra23PackageQuery(TGotoShallJumpToLabelDeclaredLaterInTheFunctionQuery())) - } - - Query functionDeclaredWithTheNoreturnAttributeReturnQuery() { - //autogenerate `Query` type - result = - // `Query` type for `functionDeclaredWithTheNoreturnAttributeReturn` query - TQueryCPP(TImportMisra23PackageQuery(TFunctionDeclaredWithTheNoreturnAttributeReturnQuery())) - } - - Query nonVoidFunctionShallReturnAValueOnAllPathsQuery() { - //autogenerate `Query` type - result = - // `Query` type for `nonVoidFunctionShallReturnAValueOnAllPaths` query - TQueryCPP(TImportMisra23PackageQuery(TNonVoidFunctionShallReturnAValueOnAllPathsQuery())) - } -} diff --git a/cpp/common/src/codingstandards/cpp/exclusions/cpp/RuleMetadata.qll b/cpp/common/src/codingstandards/cpp/exclusions/cpp/RuleMetadata.qll index 4a6cbe936b..8dfbf9feaa 100644 --- a/cpp/common/src/codingstandards/cpp/exclusions/cpp/RuleMetadata.qll +++ b/cpp/common/src/codingstandards/cpp/exclusions/cpp/RuleMetadata.qll @@ -21,7 +21,6 @@ import Expressions import Freed import Functions import IO -import ImportMisra23 import Includes import Inheritance import Initialization @@ -75,7 +74,6 @@ newtype TCPPQuery = TFreedPackageQuery(FreedQuery q) or TFunctionsPackageQuery(FunctionsQuery q) or TIOPackageQuery(IOQuery q) or - TImportMisra23PackageQuery(ImportMisra23Query q) or TIncludesPackageQuery(IncludesQuery q) or TInheritancePackageQuery(InheritanceQuery q) or TInitializationPackageQuery(InitializationQuery q) or @@ -129,7 +127,6 @@ predicate isQueryMetadata(Query query, string queryId, string ruleId, string cat isFreedQueryMetadata(query, queryId, ruleId, category) or isFunctionsQueryMetadata(query, queryId, ruleId, category) or isIOQueryMetadata(query, queryId, ruleId, category) or - isImportMisra23QueryMetadata(query, queryId, ruleId, category) or isIncludesQueryMetadata(query, queryId, ruleId, category) or isInheritanceQueryMetadata(query, queryId, ruleId, category) or isInitializationQueryMetadata(query, queryId, ruleId, category) or diff --git a/cpp/misra/src/rules/DIR-5-7-2/SectionsOfCodeShouldNotBeCommentedOut.ql b/cpp/misra/src/rules/DIR-5-7-2/SectionsOfCodeShouldNotBeCommentedOut.ql deleted file mode 100644 index 75eb48ec67..0000000000 --- a/cpp/misra/src/rules/DIR-5-7-2/SectionsOfCodeShouldNotBeCommentedOut.ql +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @id cpp/misra/sections-of-code-should-not-be-commented-out - * @name DIR-5-7-2: Sections of code should not be “commented out” - * @description - * @kind problem - * @precision very-high - * @problem.severity error - * @tags external/misra/id/dir-5-7-2 - * maintainability - * readability - * correctness - * external/misra/obligation/advisory - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.sectionsofcodeshallnotbecommentedout.SectionsOfCodeShallNotBeCommentedOut - -class SectionsOfCodeShouldNotBeCommentedOutQuery extends SectionsOfCodeShallNotBeCommentedOutSharedQuery { - SectionsOfCodeShouldNotBeCommentedOutQuery() { - this = ImportMisra23Package::sectionsOfCodeShouldNotBeCommentedOutQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-11-3-2/DeclarationOfAnObjectIndirectionsLevel.ql b/cpp/misra/src/rules/RULE-11-3-2/DeclarationOfAnObjectIndirectionsLevel.ql deleted file mode 100644 index 21293a632f..0000000000 --- a/cpp/misra/src/rules/RULE-11-3-2/DeclarationOfAnObjectIndirectionsLevel.ql +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @id cpp/misra/declaration-of-an-object-indirections-level - * @name RULE-11-3-2: The declaration of an object should contain no more than two levels of pointer indirection - * @description - * @kind problem - * @precision very-high - * @problem.severity error - * @tags external/misra/id/rule-11-3-2 - * readability - * maintainability - * scope/single-translation-unit - * external/misra/enforcement/decidable - * external/misra/obligation/advisory - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.donotusemorethantwolevelsofpointerindirection.DoNotUseMoreThanTwoLevelsOfPointerIndirection - -class DeclarationOfAnObjectIndirectionsLevelQuery extends DoNotUseMoreThanTwoLevelsOfPointerIndirectionSharedQuery { - DeclarationOfAnObjectIndirectionsLevelQuery() { - this = ImportMisra23Package::declarationOfAnObjectIndirectionsLevelQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-18-3-3/HandlersReferToNonStaticMembersFromTheirClass.ql b/cpp/misra/src/rules/RULE-18-3-3/HandlersReferToNonStaticMembersFromTheirClass.ql deleted file mode 100644 index 81a5038151..0000000000 --- a/cpp/misra/src/rules/RULE-18-3-3/HandlersReferToNonStaticMembersFromTheirClass.ql +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @id cpp/misra/handlers-refer-to-non-static-members-from-their-class - * @name RULE-18-3-3: Handlers for a function-try-block of a constructor or destructor shall not refer to non-static - * @description Handlers for a function-try-block of a constructor or destructor shall not refer to - * non-static members from their class or its bases - * @kind problem - * @precision very-high - * @problem.severity error - * @tags external/misra/id/rule-18-3-3 - * correctness - * scope/single-translation-unit - * external/misra/enforcement/decidable - * external/misra/obligation/required - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.destroyedvaluereferencedindestructorcatchblock.DestroyedValueReferencedInDestructorCatchBlock - -class HandlersReferToNonStaticMembersFromTheirClassQuery extends DestroyedValueReferencedInDestructorCatchBlockSharedQuery { - HandlersReferToNonStaticMembersFromTheirClassQuery() { - this = ImportMisra23Package::handlersReferToNonStaticMembersFromTheirClassQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-19-0-3/IncludeDirectivesPrecededByPreprocessorDirectives.ql b/cpp/misra/src/rules/RULE-19-0-3/IncludeDirectivesPrecededByPreprocessorDirectives.ql deleted file mode 100644 index e392630616..0000000000 --- a/cpp/misra/src/rules/RULE-19-0-3/IncludeDirectivesPrecededByPreprocessorDirectives.ql +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @id cpp/misra/include-directives-preceded-by-preprocessor-directives - * @name RULE-19-0-3: #include directives should only be preceded by preprocessor directives or comments - * @description - * @kind problem - * @precision very-high - * @problem.severity error - * @tags external/misra/id/rule-19-0-3 - * readability - * scope/single-translation-unit - * external/misra/enforcement/decidable - * external/misra/obligation/advisory - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.preprocessorincludespreceded.PreprocessorIncludesPreceded - -class IncludeDirectivesPrecededByPreprocessorDirectivesQuery extends PreprocessorIncludesPrecededSharedQuery { - IncludeDirectivesPrecededByPreprocessorDirectivesQuery() { - this = ImportMisra23Package::includeDirectivesPrecededByPreprocessorDirectivesQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-19-1-3/IdentifiersUsedInTheControllingExpressionOf.ql b/cpp/misra/src/rules/RULE-19-1-3/IdentifiersUsedInTheControllingExpressionOf.ql deleted file mode 100644 index 13b604911b..0000000000 --- a/cpp/misra/src/rules/RULE-19-1-3/IdentifiersUsedInTheControllingExpressionOf.ql +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @id cpp/misra/identifiers-used-in-the-controlling-expression-of - * @name RULE-19-1-3: All identifiers used in the controlling expression of #if or #elif preprocessing directives shall be - * @description All identifiers used in the controlling expression of #if or #elif preprocessing - * directives shall be defined prior to evaluation - * @kind problem - * @precision very-high - * @problem.severity error - * @tags external/misra/id/rule-19-1-3 - * correctness - * readability - * scope/single-translation-unit - * external/misra/enforcement/decidable - * external/misra/obligation/required - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.undefinedmacroidentifiers.UndefinedMacroIdentifiers - -class IdentifiersUsedInTheControllingExpressionOfQuery extends UndefinedMacroIdentifiersSharedQuery { - IdentifiersUsedInTheControllingExpressionOfQuery() { - this = ImportMisra23Package::identifiersUsedInTheControllingExpressionOfQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-19-2-3/CharsThatShouldNotOccurInHeaderFileName.ql b/cpp/misra/src/rules/RULE-19-2-3/CharsThatShouldNotOccurInHeaderFileName.ql deleted file mode 100644 index 20a4912a28..0000000000 --- a/cpp/misra/src/rules/RULE-19-2-3/CharsThatShouldNotOccurInHeaderFileName.ql +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @id cpp/misra/chars-that-should-not-occur-in-header-file-name - * @name RULE-19-2-3: The ' or " or \ characters and the /* or // character sequences shall not occur in a header file - * @description The ' or " or \ characters and the /* or // character sequences shall not occur in a - * header file name - * @kind problem - * @precision very-high - * @problem.severity error - * @tags external/misra/id/rule-19-2-3 - * scope/single-translation-unit - * correctness - * external/misra/enforcement/decidable - * external/misra/obligation/required - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.preprocessorincludesforbiddenheadernames.PreprocessorIncludesForbiddenHeaderNames - -class CharsThatShouldNotOccurInHeaderFileNameQuery extends PreprocessorIncludesForbiddenHeaderNamesSharedQuery { - CharsThatShouldNotOccurInHeaderFileNameQuery() { - this = ImportMisra23Package::charsThatShouldNotOccurInHeaderFileNameQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-19-3-1/AndPreprocessorOperatorsShouldNotBeUsed.ql b/cpp/misra/src/rules/RULE-19-3-1/AndPreprocessorOperatorsShouldNotBeUsed.ql deleted file mode 100644 index 9b6430475e..0000000000 --- a/cpp/misra/src/rules/RULE-19-3-1/AndPreprocessorOperatorsShouldNotBeUsed.ql +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @id cpp/misra/and-preprocessor-operators-should-not-be-used - * @name RULE-19-3-1: The # and ## preprocessor operators should not be used - * @description - * @kind problem - * @precision very-high - * @problem.severity error - * @tags external/misra/id/rule-19-3-1 - * correctness - * scope/single-translation-unit - * external/misra/enforcement/decidable - * external/misra/obligation/advisory - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.hashoperatorsused.HashOperatorsUsed - -class AndPreprocessorOperatorsShouldNotBeUsedQuery extends HashOperatorsUsedSharedQuery { - AndPreprocessorOperatorsShouldNotBeUsedQuery() { - this = ImportMisra23Package::andPreprocessorOperatorsShouldNotBeUsedQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-19-3-5/TokensThatLookLikeDirectivesInAMacroArgument.ql b/cpp/misra/src/rules/RULE-19-3-5/TokensThatLookLikeDirectivesInAMacroArgument.ql deleted file mode 100644 index 3e553d0397..0000000000 --- a/cpp/misra/src/rules/RULE-19-3-5/TokensThatLookLikeDirectivesInAMacroArgument.ql +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @id cpp/misra/tokens-that-look-like-directives-in-a-macro-argument - * @name RULE-19-3-5: Tokens that look like a preprocessing directive shall not occur within a macro argument - * @description - * @kind problem - * @precision very-high - * @problem.severity error - * @tags external/misra/id/rule-19-3-5 - * readability - * correctness - * scope/single-translation-unit - * external/misra/enforcement/decidable - * external/misra/obligation/required - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.preprocessingdirectivewithinmacroargument.PreprocessingDirectiveWithinMacroArgument - -class TokensThatLookLikeDirectivesInAMacroArgumentQuery extends PreprocessingDirectiveWithinMacroArgumentSharedQuery { - TokensThatLookLikeDirectivesInAMacroArgumentQuery() { - this = ImportMisra23Package::tokensThatLookLikeDirectivesInAMacroArgumentQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-21-6-5/PointerToAnIncompleteClassTypeDeleted.ql b/cpp/misra/src/rules/RULE-21-6-5/PointerToAnIncompleteClassTypeDeleted.ql deleted file mode 100644 index 0d2de4deae..0000000000 --- a/cpp/misra/src/rules/RULE-21-6-5/PointerToAnIncompleteClassTypeDeleted.ql +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @id cpp/misra/pointer-to-an-incomplete-class-type-deleted - * @name RULE-21-6-5: A pointer to an incomplete class type shall not be deleted - * @description - * @kind problem - * @precision very-high - * @problem.severity error - * @tags external/misra/id/rule-21-6-5 - * correctness - * scope/single-translation-unit - * external/misra/enforcement/decidable - * external/misra/obligation/required - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.deleteofpointertoincompleteclass.DeleteOfPointerToIncompleteClass - -class PointerToAnIncompleteClassTypeDeletedQuery extends DeleteOfPointerToIncompleteClassSharedQuery { - PointerToAnIncompleteClassTypeDeletedQuery() { - this = ImportMisra23Package::pointerToAnIncompleteClassTypeDeletedQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-25-5-2/PointersReturnedByLocaleFunctionsMustBeUsedAsConst.ql b/cpp/misra/src/rules/RULE-25-5-2/PointersReturnedByLocaleFunctionsMustBeUsedAsConst.ql deleted file mode 100644 index 8fbb7d4d42..0000000000 --- a/cpp/misra/src/rules/RULE-25-5-2/PointersReturnedByLocaleFunctionsMustBeUsedAsConst.ql +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @id cpp/misra/pointers-returned-by-locale-functions-must-be-used-as-const - * @name RULE-25-5-2: The pointers returned by environment functions should be treated as const - * @description The pointers returned by the C++ Standard Library functions localeconv, getenv, - * setlocale or strerror must only be used as if they have pointer to const-qualified - * type - * @kind path-problem - * @precision very-high - * @problem.severity error - * @tags external/misra/id/rule-25-5-2 - * correctness - * scope/single-translation-unit - * external/misra/enforcement/decidable - * external/misra/obligation/mandatory - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.constlikereturnvalue.ConstLikeReturnValue - -class PointersReturnedByLocaleFunctionsMustBeUsedAsConstQuery extends ConstLikeReturnValueSharedQuery -{ - PointersReturnedByLocaleFunctionsMustBeUsedAsConstQuery() { - this = ImportMisra23Package::pointersReturnedByLocaleFunctionsMustBeUsedAsConstQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersMisra.ql b/cpp/misra/src/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersMisra.ql deleted file mode 100644 index 58edb5e60f..0000000000 --- a/cpp/misra/src/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersMisra.ql +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @id cpp/misra/call-to-setlocale-invalidates-old-pointers-misra - * @name RULE-25-5-3: The pointer returned by the Standard Library env functions is invalid - * @description The pointer returned by the Standard Library functions asctime, ctime, gmtime, - * localtime, localeconv, getenv, setlocale or strerror may be invalid following a - * subsequent call to the same function. - * @kind problem - * @precision very-high - * @problem.severity error - * @tags external/misra/id/rule-25-5-3 - * correctness - * scope/system - * external/misra/enforcement/undecidable - * external/misra/obligation/mandatory - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.invalidatedenvstringpointers.InvalidatedEnvStringPointers - -class CallToSetlocaleInvalidatesOldPointersMisraQuery extends InvalidatedEnvStringPointersSharedQuery { - CallToSetlocaleInvalidatesOldPointersMisraQuery() { - this = ImportMisra23Package::callToSetlocaleInvalidatesOldPointersMisraQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersWarnMisra.ql b/cpp/misra/src/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersWarnMisra.ql deleted file mode 100644 index 2b4b08bd98..0000000000 --- a/cpp/misra/src/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersWarnMisra.ql +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @id cpp/misra/call-to-setlocale-invalidates-old-pointers-warn-misra - * @name RULE-25-5-3: The pointer returned by the Standard Library env functions is invalid warning - * @description The pointer returned by the Standard Library functions asctime, ctime, gmtime, - * localtime, localeconv, getenv, setlocale or strerror may be invalid following a - * subsequent call to the same function. - * @kind problem - * @precision very-high - * @problem.severity warning - * @tags external/misra/id/rule-25-5-3 - * correctness - * scope/system - * external/misra/enforcement/undecidable - * external/misra/obligation/mandatory - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.invalidatedenvstringpointerswarn.InvalidatedEnvStringPointersWarn - -class CallToSetlocaleInvalidatesOldPointersWarnMisraQuery extends InvalidatedEnvStringPointersWarnSharedQuery { - CallToSetlocaleInvalidatesOldPointersWarnMisraQuery() { - this = ImportMisra23Package::callToSetlocaleInvalidatesOldPointersWarnMisraQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-28-6-3/ObjectUsedWhileInPotentiallyMovedFromState.ql b/cpp/misra/src/rules/RULE-28-6-3/ObjectUsedWhileInPotentiallyMovedFromState.ql deleted file mode 100644 index 416daa9c07..0000000000 --- a/cpp/misra/src/rules/RULE-28-6-3/ObjectUsedWhileInPotentiallyMovedFromState.ql +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @id cpp/misra/object-used-while-in-potentially-moved-from-state - * @name RULE-28-6-3: An object shall not be used while in a potentially moved-from state - * @description - * @kind problem - * @precision very-high - * @problem.severity error - * @tags external/misra/id/rule-28-6-3 - * correctness - * scope/single-translation-unit - * external/misra/enforcement/decidable - * external/misra/obligation/required - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.movedfromobjectsunspecifiedstate.MovedFromObjectsUnspecifiedState - -class ObjectUsedWhileInPotentiallyMovedFromStateQuery extends MovedFromObjectsUnspecifiedStateSharedQuery { - ObjectUsedWhileInPotentiallyMovedFromStateQuery() { - this = ImportMisra23Package::objectUsedWhileInPotentiallyMovedFromStateQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-30-0-2/ReadsAndWritesOnStreamNotSeparatedByPositioning.ql b/cpp/misra/src/rules/RULE-30-0-2/ReadsAndWritesOnStreamNotSeparatedByPositioning.ql deleted file mode 100644 index a209347915..0000000000 --- a/cpp/misra/src/rules/RULE-30-0-2/ReadsAndWritesOnStreamNotSeparatedByPositioning.ql +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @id cpp/misra/reads-and-writes-on-stream-not-separated-by-positioning - * @name RULE-30-0-2: Reads and writes on the same file stream shall be separated by a positioning operation - * @description - * @kind problem - * @precision very-high - * @problem.severity error - * @tags external/misra/id/rule-30-0-2 - * correctness - * scope/system - * external/misra/enforcement/undecidable - * external/misra/obligation/required - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.iofstreammissingpositioning.IOFstreamMissingPositioning - -class ReadsAndWritesOnStreamNotSeparatedByPositioningQuery extends IOFstreamMissingPositioningSharedQuery { - ReadsAndWritesOnStreamNotSeparatedByPositioningQuery() { - this = ImportMisra23Package::readsAndWritesOnStreamNotSeparatedByPositioningQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-6-2-1/OneDefinitionRuleViolated.ql b/cpp/misra/src/rules/RULE-6-2-1/OneDefinitionRuleViolated.ql deleted file mode 100644 index b682c354a5..0000000000 --- a/cpp/misra/src/rules/RULE-6-2-1/OneDefinitionRuleViolated.ql +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @id cpp/misra/one-definition-rule-violated - * @name RULE-6-2-1: The one-definition rule shall not be violated - * @description - * @kind problem - * @precision very-high - * @problem.severity error - * @tags external/misra/id/rule-6-2-1 - * correctness - * scope/system - * external/misra/enforcement/decidable - * external/misra/obligation/required - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.onedefinitionruleviolation.OneDefinitionRuleViolation - -class OneDefinitionRuleViolatedQuery extends OneDefinitionRuleViolationSharedQuery { - OneDefinitionRuleViolatedQuery() { - this = ImportMisra23Package::oneDefinitionRuleViolatedQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-6-4-1/VariableDeclaredInInnerScopeHidesOuterScope.ql b/cpp/misra/src/rules/RULE-6-4-1/VariableDeclaredInInnerScopeHidesOuterScope.ql deleted file mode 100644 index 1813ebc77a..0000000000 --- a/cpp/misra/src/rules/RULE-6-4-1/VariableDeclaredInInnerScopeHidesOuterScope.ql +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @id cpp/misra/variable-declared-in-inner-scope-hides-outer-scope - * @name RULE-6-4-1: A variable declared in an inner scope shall not hide a variable declared in an outer scope - * @description - * @kind problem - * @precision very-high - * @problem.severity error - * @tags external/misra/id/rule-6-4-1 - * readability - * maintainability - * scope/single-translation-unit - * external/misra/enforcement/decidable - * external/misra/obligation/required - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.identifierhidden.IdentifierHidden - -class VariableDeclaredInInnerScopeHidesOuterScopeQuery extends IdentifierHiddenSharedQuery { - VariableDeclaredInInnerScopeHidesOuterScopeQuery() { - this = ImportMisra23Package::variableDeclaredInInnerScopeHidesOuterScopeQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-6-8-1/ObjectAccessedAfterLifetimeMisra.ql b/cpp/misra/src/rules/RULE-6-8-1/ObjectAccessedAfterLifetimeMisra.ql deleted file mode 100644 index 77483fdedb..0000000000 --- a/cpp/misra/src/rules/RULE-6-8-1/ObjectAccessedAfterLifetimeMisra.ql +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @id cpp/misra/object-accessed-after-lifetime-misra - * @name RULE-6-8-1: Access of object after lifetime (use-after-free) - * @description Accessing an object after its lifetime results in undefined behavior. - * @kind problem - * @precision high - * @problem.severity error - * @tags external/misra/id/rule-6-8-1 - * correctness - * security - * external/misra/enforcement/undecidable - * external/misra/obligation/required - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.objectaccessedafterlifetime.ObjectAccessedAfterLifetime - -class ObjectAccessedAfterLifetimeMisraQuery extends ObjectAccessedAfterLifetimeSharedQuery { - ObjectAccessedAfterLifetimeMisraQuery() { - this = ImportMisra23Package::objectAccessedAfterLifetimeMisraQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-6-8-1/ObjectAccessedBeforeLifetimeMisra.ql b/cpp/misra/src/rules/RULE-6-8-1/ObjectAccessedBeforeLifetimeMisra.ql deleted file mode 100644 index e0e82f2396..0000000000 --- a/cpp/misra/src/rules/RULE-6-8-1/ObjectAccessedBeforeLifetimeMisra.ql +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @id cpp/misra/object-accessed-before-lifetime-misra - * @name RULE-6-8-1: Access of uninitialized object - * @description Accessing an object before its lifetime can result in undefined behavior. - * @kind problem - * @precision high - * @problem.severity error - * @tags external/misra/id/rule-6-8-1 - * correctness - * security - * external/misra/enforcement/undecidable - * external/misra/obligation/required - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.objectaccessedbeforelifetime.ObjectAccessedBeforeLifetime - -class ObjectAccessedBeforeLifetimeMisraQuery extends ObjectAccessedBeforeLifetimeSharedQuery { - ObjectAccessedBeforeLifetimeMisraQuery() { - this = ImportMisra23Package::objectAccessedBeforeLifetimeMisraQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-8-2-3/CastRemovesConstOrVolatileFromPointerOrReference.ql b/cpp/misra/src/rules/RULE-8-2-3/CastRemovesConstOrVolatileFromPointerOrReference.ql deleted file mode 100644 index 0c2e56b5bd..0000000000 --- a/cpp/misra/src/rules/RULE-8-2-3/CastRemovesConstOrVolatileFromPointerOrReference.ql +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @id cpp/misra/cast-removes-const-or-volatile-from-pointer-or-reference - * @name RULE-8-2-3: A cast shall not remove any const or volatile qualification from the type accessed via a pointer or - * @description A cast shall not remove any const or volatile qualification from the type accessed - * via a pointer or by reference - * @kind problem - * @precision very-high - * @problem.severity error - * @tags external/misra/id/rule-8-2-3 - * correctness - * scope/single-translation-unit - * external/misra/enforcement/decidable - * external/misra/obligation/required - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.removeconstorvolatilequalification.RemoveConstOrVolatileQualification - -class CastRemovesConstOrVolatileFromPointerOrReferenceQuery extends RemoveConstOrVolatileQualificationSharedQuery { - CastRemovesConstOrVolatileFromPointerOrReferenceQuery() { - this = ImportMisra23Package::castRemovesConstOrVolatileFromPointerOrReferenceQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-9-4-1/IfElseIfEndCondition.ql b/cpp/misra/src/rules/RULE-9-4-1/IfElseIfEndCondition.ql deleted file mode 100644 index 2345e3f25f..0000000000 --- a/cpp/misra/src/rules/RULE-9-4-1/IfElseIfEndCondition.ql +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @id cpp/misra/if-else-if-end-condition - * @name RULE-9-4-1: All if - * @description All if ... else if constructs shall be terminated with an else statement - * @kind problem - * @precision very-high - * @problem.severity error - * @tags external/misra/id/rule-9-4-1 - * readability - * maintainability - * scope/single-translation-unit - * external/misra/enforcement/decidable - * external/misra/obligation/required - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.ifelseterminationconstruct.IfElseTerminationConstruct - -class IfElseIfEndConditionQuery extends IfElseTerminationConstructSharedQuery { - IfElseIfEndConditionQuery() { - this = ImportMisra23Package::ifElseIfEndConditionQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-9-6-3/GotoShallJumpToLabelDeclaredLaterInTheFunction.ql b/cpp/misra/src/rules/RULE-9-6-3/GotoShallJumpToLabelDeclaredLaterInTheFunction.ql deleted file mode 100644 index c0e5e0fe83..0000000000 --- a/cpp/misra/src/rules/RULE-9-6-3/GotoShallJumpToLabelDeclaredLaterInTheFunction.ql +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @id cpp/misra/goto-shall-jump-to-label-declared-later-in-the-function - * @name RULE-9-6-3: The goto statement shall jump to a label declared later in the function body - * @description - * @kind problem - * @precision very-high - * @problem.severity error - * @tags external/misra/id/rule-9-6-3 - * maintainability - * readability - * scope/single-translation-unit - * external/misra/enforcement/decidable - * external/misra/obligation/required - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.gotostatementcondition.GotoStatementCondition - -class GotoShallJumpToLabelDeclaredLaterInTheFunctionQuery extends GotoStatementConditionSharedQuery { - GotoShallJumpToLabelDeclaredLaterInTheFunctionQuery() { - this = ImportMisra23Package::gotoShallJumpToLabelDeclaredLaterInTheFunctionQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-9-6-4/FunctionDeclaredWithTheNoreturnAttributeReturn.ql b/cpp/misra/src/rules/RULE-9-6-4/FunctionDeclaredWithTheNoreturnAttributeReturn.ql deleted file mode 100644 index 23221348c0..0000000000 --- a/cpp/misra/src/rules/RULE-9-6-4/FunctionDeclaredWithTheNoreturnAttributeReturn.ql +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @id cpp/misra/function-declared-with-the-noreturn-attribute-return - * @name RULE-9-6-4: A function declared with the [[noreturn]] attribute shall not return - * @description - * @kind problem - * @precision very-high - * @problem.severity error - * @tags external/misra/id/rule-9-6-4 - * correctness - * scope/system - * external/misra/enforcement/undecidable - * external/misra/obligation/required - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.functionnoreturnattributecondition.FunctionNoReturnAttributeCondition - -class FunctionDeclaredWithTheNoreturnAttributeReturnQuery extends FunctionNoReturnAttributeConditionSharedQuery { - FunctionDeclaredWithTheNoreturnAttributeReturnQuery() { - this = ImportMisra23Package::functionDeclaredWithTheNoreturnAttributeReturnQuery() - } -} diff --git a/cpp/misra/src/rules/RULE-9-6-5/NonVoidFunctionShallReturnAValueOnAllPaths.ql b/cpp/misra/src/rules/RULE-9-6-5/NonVoidFunctionShallReturnAValueOnAllPaths.ql deleted file mode 100644 index 74802bcee9..0000000000 --- a/cpp/misra/src/rules/RULE-9-6-5/NonVoidFunctionShallReturnAValueOnAllPaths.ql +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @id cpp/misra/non-void-function-shall-return-a-value-on-all-paths - * @name RULE-9-6-5: A function with non-void return type shall return a value on all paths - * @description - * @kind problem - * @precision very-high - * @problem.severity error - * @tags external/misra/id/rule-9-6-5 - * correctness - * scope/single-translation-unit - * external/misra/enforcement/decidable - * external/misra/obligation/required - */ - -import cpp -import codingstandards.cpp.misra -import codingstandards.cpp.rules.nonvoidfunctiondoesnotreturn.NonVoidFunctionDoesNotReturn - -class NonVoidFunctionShallReturnAValueOnAllPathsQuery extends NonVoidFunctionDoesNotReturnSharedQuery { - NonVoidFunctionShallReturnAValueOnAllPathsQuery() { - this = ImportMisra23Package::nonVoidFunctionShallReturnAValueOnAllPathsQuery() - } -} diff --git a/cpp/misra/test/rules/DIR-5-7-2/SectionsOfCodeShouldNotBeCommentedOut.testref b/cpp/misra/test/rules/DIR-5-7-2/SectionsOfCodeShouldNotBeCommentedOut.testref deleted file mode 100644 index 303a38a19b..0000000000 --- a/cpp/misra/test/rules/DIR-5-7-2/SectionsOfCodeShouldNotBeCommentedOut.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/sectionsofcodeshallnotbecommentedout/SectionsOfCodeShallNotBeCommentedOut.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-11-3-2/DeclarationOfAnObjectIndirectionsLevel.testref b/cpp/misra/test/rules/RULE-11-3-2/DeclarationOfAnObjectIndirectionsLevel.testref deleted file mode 100644 index 3b46dca736..0000000000 --- a/cpp/misra/test/rules/RULE-11-3-2/DeclarationOfAnObjectIndirectionsLevel.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/donotusemorethantwolevelsofpointerindirection/DoNotUseMoreThanTwoLevelsOfPointerIndirection.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-18-3-3/HandlersReferToNonStaticMembersFromTheirClass.testref b/cpp/misra/test/rules/RULE-18-3-3/HandlersReferToNonStaticMembersFromTheirClass.testref deleted file mode 100644 index 7d4f5826b0..0000000000 --- a/cpp/misra/test/rules/RULE-18-3-3/HandlersReferToNonStaticMembersFromTheirClass.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/destroyedvaluereferencedindestructorcatchblock/DestroyedValueReferencedInDestructorCatchBlock.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-19-0-3/IncludeDirectivesPrecededByPreprocessorDirectives.testref b/cpp/misra/test/rules/RULE-19-0-3/IncludeDirectivesPrecededByPreprocessorDirectives.testref deleted file mode 100644 index 7992898cfc..0000000000 --- a/cpp/misra/test/rules/RULE-19-0-3/IncludeDirectivesPrecededByPreprocessorDirectives.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/preprocessorincludespreceded/PreprocessorIncludesPreceded.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-19-1-3/IdentifiersUsedInTheControllingExpressionOf.testref b/cpp/misra/test/rules/RULE-19-1-3/IdentifiersUsedInTheControllingExpressionOf.testref deleted file mode 100644 index 73eb246867..0000000000 --- a/cpp/misra/test/rules/RULE-19-1-3/IdentifiersUsedInTheControllingExpressionOf.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/undefinedmacroidentifiers/UndefinedMacroIdentifiers.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-19-2-3/CharsThatShouldNotOccurInHeaderFileName.testref b/cpp/misra/test/rules/RULE-19-2-3/CharsThatShouldNotOccurInHeaderFileName.testref deleted file mode 100644 index 6be2f4f7ba..0000000000 --- a/cpp/misra/test/rules/RULE-19-2-3/CharsThatShouldNotOccurInHeaderFileName.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/preprocessorincludesforbiddenheadernames/PreprocessorIncludesForbiddenHeaderNames.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-19-3-1/AndPreprocessorOperatorsShouldNotBeUsed.testref b/cpp/misra/test/rules/RULE-19-3-1/AndPreprocessorOperatorsShouldNotBeUsed.testref deleted file mode 100644 index eec0b94b11..0000000000 --- a/cpp/misra/test/rules/RULE-19-3-1/AndPreprocessorOperatorsShouldNotBeUsed.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/hashoperatorsused/HashOperatorsUsed.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-19-3-5/TokensThatLookLikeDirectivesInAMacroArgument.testref b/cpp/misra/test/rules/RULE-19-3-5/TokensThatLookLikeDirectivesInAMacroArgument.testref deleted file mode 100644 index 1e15c636ee..0000000000 --- a/cpp/misra/test/rules/RULE-19-3-5/TokensThatLookLikeDirectivesInAMacroArgument.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/preprocessingdirectivewithinmacroargument/PreprocessingDirectiveWithinMacroArgument.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-21-6-5/PointerToAnIncompleteClassTypeDeleted.testref b/cpp/misra/test/rules/RULE-21-6-5/PointerToAnIncompleteClassTypeDeleted.testref deleted file mode 100644 index 3f4895b1c4..0000000000 --- a/cpp/misra/test/rules/RULE-21-6-5/PointerToAnIncompleteClassTypeDeleted.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/deleteofpointertoincompleteclass/DeleteOfPointerToIncompleteClass.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-25-5-2/PointersReturnedByLocaleFunctionsMustBeUsedAsConst.testref b/cpp/misra/test/rules/RULE-25-5-2/PointersReturnedByLocaleFunctionsMustBeUsedAsConst.testref deleted file mode 100644 index febf2e9d50..0000000000 --- a/cpp/misra/test/rules/RULE-25-5-2/PointersReturnedByLocaleFunctionsMustBeUsedAsConst.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/constlikereturnvalue/ConstLikeReturnValue.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersMisra.testref b/cpp/misra/test/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersMisra.testref deleted file mode 100644 index 74cb92bd88..0000000000 --- a/cpp/misra/test/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersMisra.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/invalidatedenvstringpointers/InvalidatedEnvStringPointers.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersWarnMisra.testref b/cpp/misra/test/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersWarnMisra.testref deleted file mode 100644 index 1628a12aa9..0000000000 --- a/cpp/misra/test/rules/RULE-25-5-3/CallToSetlocaleInvalidatesOldPointersWarnMisra.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/invalidatedenvstringpointerswarn/InvalidatedEnvStringPointersWarn.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-28-6-3/ObjectUsedWhileInPotentiallyMovedFromState.testref b/cpp/misra/test/rules/RULE-28-6-3/ObjectUsedWhileInPotentiallyMovedFromState.testref deleted file mode 100644 index 5ae8b65a71..0000000000 --- a/cpp/misra/test/rules/RULE-28-6-3/ObjectUsedWhileInPotentiallyMovedFromState.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/movedfromobjectsunspecifiedstate/MovedFromObjectsUnspecifiedState.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-30-0-2/ReadsAndWritesOnStreamNotSeparatedByPositioning.testref b/cpp/misra/test/rules/RULE-30-0-2/ReadsAndWritesOnStreamNotSeparatedByPositioning.testref deleted file mode 100644 index 0a8adf7272..0000000000 --- a/cpp/misra/test/rules/RULE-30-0-2/ReadsAndWritesOnStreamNotSeparatedByPositioning.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/iofstreammissingpositioning/IOFstreamMissingPositioning.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-6-2-1/OneDefinitionRuleViolated.testref b/cpp/misra/test/rules/RULE-6-2-1/OneDefinitionRuleViolated.testref deleted file mode 100644 index b51950abaa..0000000000 --- a/cpp/misra/test/rules/RULE-6-2-1/OneDefinitionRuleViolated.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/onedefinitionruleviolation/OneDefinitionRuleViolation.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-6-4-1/VariableDeclaredInInnerScopeHidesOuterScope.testref b/cpp/misra/test/rules/RULE-6-4-1/VariableDeclaredInInnerScopeHidesOuterScope.testref deleted file mode 100644 index 2f41afee3b..0000000000 --- a/cpp/misra/test/rules/RULE-6-4-1/VariableDeclaredInInnerScopeHidesOuterScope.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/identifierhidden/IdentifierHidden.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-6-8-1/ObjectAccessedAfterLifetimeMisra.testref b/cpp/misra/test/rules/RULE-6-8-1/ObjectAccessedAfterLifetimeMisra.testref deleted file mode 100644 index 979e12ac8c..0000000000 --- a/cpp/misra/test/rules/RULE-6-8-1/ObjectAccessedAfterLifetimeMisra.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/objectaccessedafterlifetime/ObjectAccessedAfterLifetime.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-6-8-1/ObjectAccessedBeforeLifetimeMisra.testref b/cpp/misra/test/rules/RULE-6-8-1/ObjectAccessedBeforeLifetimeMisra.testref deleted file mode 100644 index 3f22c45632..0000000000 --- a/cpp/misra/test/rules/RULE-6-8-1/ObjectAccessedBeforeLifetimeMisra.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/objectaccessedbeforelifetime/ObjectAccessedBeforeLifetime.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-8-2-3/CastRemovesConstOrVolatileFromPointerOrReference.testref b/cpp/misra/test/rules/RULE-8-2-3/CastRemovesConstOrVolatileFromPointerOrReference.testref deleted file mode 100644 index 000469493a..0000000000 --- a/cpp/misra/test/rules/RULE-8-2-3/CastRemovesConstOrVolatileFromPointerOrReference.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/removeconstorvolatilequalification/RemoveConstOrVolatileQualification.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-9-4-1/IfElseIfEndCondition.testref b/cpp/misra/test/rules/RULE-9-4-1/IfElseIfEndCondition.testref deleted file mode 100644 index d7ca04a26e..0000000000 --- a/cpp/misra/test/rules/RULE-9-4-1/IfElseIfEndCondition.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/ifelseterminationconstruct/IfElseTerminationConstruct.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-9-6-3/GotoShallJumpToLabelDeclaredLaterInTheFunction.testref b/cpp/misra/test/rules/RULE-9-6-3/GotoShallJumpToLabelDeclaredLaterInTheFunction.testref deleted file mode 100644 index b4f807e8e2..0000000000 --- a/cpp/misra/test/rules/RULE-9-6-3/GotoShallJumpToLabelDeclaredLaterInTheFunction.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/gotostatementcondition/GotoStatementCondition.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-9-6-4/FunctionDeclaredWithTheNoreturnAttributeReturn.testref b/cpp/misra/test/rules/RULE-9-6-4/FunctionDeclaredWithTheNoreturnAttributeReturn.testref deleted file mode 100644 index dec8006f15..0000000000 --- a/cpp/misra/test/rules/RULE-9-6-4/FunctionDeclaredWithTheNoreturnAttributeReturn.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/functionnoreturnattributecondition/FunctionNoReturnAttributeCondition.ql \ No newline at end of file diff --git a/cpp/misra/test/rules/RULE-9-6-5/NonVoidFunctionShallReturnAValueOnAllPaths.testref b/cpp/misra/test/rules/RULE-9-6-5/NonVoidFunctionShallReturnAValueOnAllPaths.testref deleted file mode 100644 index ef9b3c1fc2..0000000000 --- a/cpp/misra/test/rules/RULE-9-6-5/NonVoidFunctionShallReturnAValueOnAllPaths.testref +++ /dev/null @@ -1 +0,0 @@ -cpp/common/test/rules/nonvoidfunctiondoesnotreturn/NonVoidFunctionDoesNotReturn.ql \ No newline at end of file diff --git a/rule_packages/cpp/ImportMisra23.json b/rule_packages/cpp/ImportMisra23.json deleted file mode 100644 index 259e3f8a17..0000000000 --- a/rule_packages/cpp/ImportMisra23.json +++ /dev/null @@ -1,505 +0,0 @@ -{ - "MISRA-C++-2023": { - "DIR-5-7-2": { - "properties": { - "obligation": "advisory" - }, - "queries": [ - { - "description": "", - "kind": "problem", - "name": "Sections of code should not be \u201ccommented out\u201d", - "precision": "very-high", - "severity": "error", - "short_name": "SectionsOfCodeShouldNotBeCommentedOut", - "shared_implementation_short_name": "SectionsOfCodeShallNotBeCommentedOut", - "tags": [ - "maintainability", - "readability", - "correctness" - ] - } - ], - "title": "Sections of code should not be \u201ccommented out\u201d" - }, - "RULE-6-2-1": { - "properties": { - "enforcement": "decidable", - "obligation": "required" - }, - "queries": [ - { - "description": "", - "kind": "problem", - "name": "The one-definition rule shall not be violated", - "precision": "very-high", - "severity": "error", - "short_name": "OneDefinitionRuleViolated", - "shared_implementation_short_name": "OneDefinitionRuleViolation", - "tags": [ - "correctness", - "scope/system" - ] - } - ], - "title": "The one-definition rule shall not be violated" - }, - "RULE-6-4-1": { - "properties": { - "enforcement": "decidable", - "obligation": "required" - }, - "queries": [ - { - "description": "", - "kind": "problem", - "name": "A variable declared in an inner scope shall not hide a variable declared in an outer scope", - "precision": "very-high", - "severity": "error", - "short_name": "VariableDeclaredInInnerScopeHidesOuterScope", - "shared_implementation_short_name": "IdentifierHidden", - "tags": [ - "readability", - "maintainability", - "scope/single-translation-unit" - ] - } - ], - "title": "A variable declared in an inner scope shall not hide a variable declared in an outer scope" - }, - "RULE-6-8-1": { - "properties": { - "enforcement": "undecidable", - "obligation": "required" - }, - "queries": [ - { - "description": "Accessing an object before its lifetime can result in undefined behavior.", - "kind": "problem", - "name": "Access of uninitialized object", - "precision": "high", - "severity": "error", - "shared_implementation_short_name": "ObjectAccessedBeforeLifetime", - "short_name": "ObjectAccessedBeforeLifetimeMisra", - "tags": [ - "correctness", - "security" - ] - }, - { - "description": "Accessing an object after its lifetime results in undefined behavior.", - "kind": "problem", - "name": "Access of object after lifetime (use-after-free)", - "precision": "high", - "severity": "error", - "shared_implementation_short_name": "ObjectAccessedAfterLifetime", - "short_name": "ObjectAccessedAfterLifetimeMisra", - "tags": [ - "correctness", - "security" - ] - } - ], - "title": "An object shall not be accessed outside of its lifetime" - }, - "RULE-8-2-3": { - "properties": { - "enforcement": "decidable", - "obligation": "required" - }, - "queries": [ - { - "description": "A cast shall not remove any const or volatile qualification from the type accessed via a pointer or by reference", - "kind": "problem", - "name": "A cast shall not remove any const or volatile qualification from the type accessed via a pointer or", - "precision": "very-high", - "severity": "error", - "short_name": "CastRemovesConstOrVolatileFromPointerOrReference", - "shared_implementation_short_name": "RemoveConstOrVolatileQualification", - "tags": [ - "correctness", - "scope/single-translation-unit" - ] - } - ], - "title": "A cast shall not remove any const or volatile qualification from the type accessed via a pointer or by reference" - }, - "RULE-9-4-1": { - "properties": { - "enforcement": "decidable", - "obligation": "required" - }, - "queries": [ - { - "description": "All if ... else if constructs shall be terminated with an else statement", - "kind": "problem", - "name": "All if ", - "precision": "very-high", - "severity": "error", - "short_name": "IfElseIfEndCondition", - "shared_implementation_short_name": "IfElseTerminationConstruct", - "tags": [ - "readability", - "maintainability", - "scope/single-translation-unit" - ] - } - ], - "title": "All if ... else if constructs shall be terminated with an else statement" - }, - "RULE-9-6-3": { - "properties": { - "enforcement": "decidable", - "obligation": "required" - }, - "queries": [ - { - "description": "", - "kind": "problem", - "name": "The goto statement shall jump to a label declared later in the function body", - "precision": "very-high", - "severity": "error", - "short_name": "GotoShallJumpToLabelDeclaredLaterInTheFunction", - "shared_implementation_short_name": "GotoStatementCondition", - "tags": [ - "maintainability", - "readability", - "scope/single-translation-unit" - ] - } - ], - "title": "The goto statement shall jump to a label declared later in the function body" - }, - "RULE-9-6-4": { - "properties": { - "enforcement": "undecidable", - "obligation": "required" - }, - "queries": [ - { - "description": "", - "kind": "problem", - "name": "A function declared with the [[noreturn]] attribute shall not return", - "precision": "very-high", - "severity": "error", - "short_name": "FunctionDeclaredWithTheNoreturnAttributeReturn", - "shared_implementation_short_name": "FunctionNoReturnAttributeCondition", - "tags": [ - "correctness", - "scope/system" - ] - } - ], - "title": "A function declared with the [[noreturn]] attribute shall not return" - }, - "RULE-9-6-5": { - "properties": { - "enforcement": "decidable", - "obligation": "required" - }, - "queries": [ - { - "description": "", - "kind": "problem", - "name": "A function with non-void return type shall return a value on all paths", - "precision": "very-high", - "severity": "error", - "short_name": "NonVoidFunctionShallReturnAValueOnAllPaths", - "shared_implementation_short_name": "NonVoidFunctionDoesNotReturn", - "tags": [ - "correctness", - "scope/single-translation-unit" - ] - } - ], - "title": "A function with non-void return type shall return a value on all paths" - }, - "RULE-11-3-2": { - "properties": { - "enforcement": "decidable", - "obligation": "advisory" - }, - "queries": [ - { - "description": "", - "kind": "problem", - "name": "The declaration of an object should contain no more than two levels of pointer indirection", - "precision": "very-high", - "severity": "error", - "short_name": "DeclarationOfAnObjectIndirectionsLevel", - "shared_implementation_short_name": "DoNotUseMoreThanTwoLevelsOfPointerIndirection", - "tags": [ - "readability", - "maintainability", - "scope/single-translation-unit" - ] - } - ], - "title": "The declaration of an object should contain no more than two levels of pointer indirection" - }, - "RULE-18-3-3": { - "properties": { - "enforcement": "decidable", - "obligation": "required" - }, - "queries": [ - { - "description": "Handlers for a function-try-block of a constructor or destructor shall not refer to non-static members from their class or its bases", - "kind": "problem", - "name": "Handlers for a function-try-block of a constructor or destructor shall not refer to non-static", - "precision": "very-high", - "severity": "error", - "short_name": "HandlersReferToNonStaticMembersFromTheirClass", - "shared_implementation_short_name": "DestroyedValueReferencedInDestructorCatchBlock", - "tags": [ - "correctness", - "scope/single-translation-unit" - ] - } - ], - "title": "Handlers for a function-try-block of a constructor or destructor shall not refer to non-static members from their class or its bases" - }, - "RULE-19-0-3": { - "properties": { - "enforcement": "decidable", - "obligation": "advisory" - }, - "queries": [ - { - "description": "", - "kind": "problem", - "name": "#include directives should only be preceded by preprocessor directives or comments", - "precision": "very-high", - "severity": "error", - "short_name": "IncludeDirectivesPrecededByPreprocessorDirectives", - "shared_implementation_short_name": "PreprocessorIncludesPreceded", - "tags": [ - "readability", - "scope/single-translation-unit" - ] - } - ], - "title": "#include directives should only be preceded by preprocessor directives or comments" - }, - "RULE-19-1-3": { - "properties": { - "enforcement": "decidable", - "obligation": "required" - }, - "queries": [ - { - "description": "All identifiers used in the controlling expression of #if or #elif preprocessing directives shall be defined prior to evaluation", - "kind": "problem", - "name": "All identifiers used in the controlling expression of #if or #elif preprocessing directives shall be", - "precision": "very-high", - "severity": "error", - "short_name": "IdentifiersUsedInTheControllingExpressionOf", - "shared_implementation_short_name": "UndefinedMacroIdentifiers", - "tags": [ - "correctness", - "readability", - "scope/single-translation-unit" - ] - } - ], - "title": "All identifiers used in the controlling expression of #if or #elif preprocessing directives shall be defined prior to evaluation" - }, - "RULE-19-2-3": { - "properties": { - "enforcement": "decidable", - "obligation": "required" - }, - "queries": [ - { - "description": "The ' or \" or \\ characters and the /* or // character sequences shall not occur in a header file name", - "kind": "problem", - "name": "The ' or \" or \\ characters and the /* or // character sequences shall not occur in a header file", - "precision": "very-high", - "severity": "error", - "short_name": "CharsThatShouldNotOccurInHeaderFileName", - "shared_implementation_short_name": "PreprocessorIncludesForbiddenHeaderNames", - "tags": [ - "scope/single-translation-unit", - "correctness" - ], - "implementation_scope": { - "description": "This query identifies the use of the ', \\, /*, // characters in header file names. The query is not able to detect the use of the \" character in header file names.", - "items": [] - } - } - ], - "title": "The ' or \" or \\ characters and the /* or // character sequences shall not occur in a header file name" - }, - "RULE-19-3-1": { - "properties": { - "enforcement": "decidable", - "obligation": "advisory" - }, - "queries": [ - { - "description": "", - "kind": "problem", - "name": "The # and ## preprocessor operators should not be used", - "precision": "very-high", - "severity": "error", - "short_name": "AndPreprocessorOperatorsShouldNotBeUsed", - "shared_implementation_short_name": "HashOperatorsUsed", - "tags": [ - "correctness", - "scope/single-translation-unit" - ] - } - ], - "title": "The # and ## preprocessor operators should not be used" - }, - "RULE-19-3-5": { - "properties": { - "enforcement": "decidable", - "obligation": "required" - }, - "queries": [ - { - "description": "", - "kind": "problem", - "name": "Tokens that look like a preprocessing directive shall not occur within a macro argument", - "precision": "very-high", - "severity": "error", - "short_name": "TokensThatLookLikeDirectivesInAMacroArgument", - "shared_implementation_short_name": "PreprocessingDirectiveWithinMacroArgument", - "tags": [ - "readability", - "correctness", - "scope/single-translation-unit" - ] - } - ], - "title": "Tokens that look like a preprocessing directive shall not occur within a macro argument" - }, - "RULE-21-6-5": { - "properties": { - "enforcement": "decidable", - "obligation": "required" - }, - "queries": [ - { - "description": "", - "kind": "problem", - "name": "A pointer to an incomplete class type shall not be deleted", - "precision": "very-high", - "severity": "error", - "short_name": "PointerToAnIncompleteClassTypeDeleted", - "shared_implementation_short_name": "DeleteOfPointerToIncompleteClass", - "tags": [ - "correctness", - "scope/single-translation-unit" - ] - } - ], - "title": "A pointer to an incomplete class type shall not be deleted" - }, - "RULE-25-5-2": { - "properties": { - "enforcement": "decidable", - "obligation": "mandatory" - }, - "queries": [ - { - "description": "The pointers returned by the C++ Standard Library functions localeconv, getenv, setlocale or strerror must only be used as if they have pointer to const-qualified type", - "kind": "problem", - "name": "The pointers returned by environment functions should be treated as const", - "precision": "very-high", - "severity": "error", - "short_name": "PointersReturnedByLocaleFunctionsMustBeUsedAsConst", - "shared_implementation_short_name": "ConstLikeReturnValue", - "tags": [ - "correctness", - "scope/single-translation-unit" - ] - } - ], - "title": "The pointers returned by the C++ Standard Library functions localeconv, getenv, setlocale or strerror must only be used as if they have pointer to const-qualified type" - }, - "RULE-25-5-3": { - "properties": { - "enforcement": "undecidable", - "obligation": "mandatory" - }, - "queries": [ - { - "description": "The pointer returned by the Standard Library functions asctime, ctime, gmtime, localtime, localeconv, getenv, setlocale or strerror may be invalid following a subsequent call to the same function.", - "kind": "problem", - "name": "The pointer returned by the Standard Library env functions is invalid", - "precision": "very-high", - "severity": "error", - "short_name": "CallToSetlocaleInvalidatesOldPointersMisra", - "shared_implementation_short_name": "InvalidatedEnvStringPointers", - "tags": [ - "correctness", - "scope/system" - ] - }, - { - "description": "The pointer returned by the Standard Library functions asctime, ctime, gmtime, localtime, localeconv, getenv, setlocale or strerror may be invalid following a subsequent call to the same function.", - "kind": "problem", - "name": "The pointer returned by the Standard Library env functions is invalid warning", - "precision": "very-high", - "severity": "warning", - "short_name": "CallToSetlocaleInvalidatesOldPointersWarnMisra", - "shared_implementation_short_name": "InvalidatedEnvStringPointersWarn", - "tags": [ - "correctness", - "scope/system" - ] - } - ], - "title": "The pointer returned by the C++ Standard Library functions asctime, ctime, gmtime, localtime, localeconv, getenv, setlocale or strerror must not be used following a subsequent call to the same function" - }, - "RULE-28-6-3": { - "properties": { - "enforcement": "decidable", - "obligation": "required" - }, - "queries": [ - { - "description": "", - "kind": "problem", - "name": "An object shall not be used while in a potentially moved-from state", - "precision": "very-high", - "severity": "error", - "short_name": "ObjectUsedWhileInPotentiallyMovedFromState", - "shared_implementation_short_name": "MovedFromObjectsUnspecifiedState", - "tags": [ - "correctness", - "scope/single-translation-unit" - ] - } - ], - "title": "An object shall not be used while in a potentially moved-from state" - }, - "RULE-30-0-2": { - "properties": { - "enforcement": "undecidable", - "obligation": "required" - }, - "queries": [ - { - "description": "", - "kind": "problem", - "name": "Reads and writes on the same file stream shall be separated by a positioning operation", - "precision": "very-high", - "severity": "error", - "short_name": "ReadsAndWritesOnStreamNotSeparatedByPositioning", - "shared_implementation_short_name": "IOFstreamMissingPositioning", - "tags": [ - "correctness", - "scope/system" - ], - "implementation_scope": { - "description": "The rule is enforced in the context of a single function." - } - } - ], - "title": "Reads and writes on the same file stream shall be separated by a positioning operation" - } - } -} \ No newline at end of file diff --git a/rules.csv b/rules.csv index 239ac09023..913aa27282 100644 --- a/rules.csv +++ b/rules.csv @@ -511,7 +511,7 @@ c,CERT-C,ENV31-C,Yes,Rule,,,Do not rely on an environment pointer following an o c,CERT-C,ENV32-C,Yes,Rule,,,All exit handlers must return normally,,Contracts2,Medium, c,CERT-C,ENV33-C,Yes,Rule,,,Do not call system(),"RULE-21-21, M18-0-3",Banned,Easy, c,CERT-C,ENV34-C,Yes,Rule,,,Do not store pointers returned by certain functions,RULE-21-20,Contracts2,Medium, -c,CERT-C,ERR30-C,Yes,Rule,,,Take care when reading errno,M19-3-1,Contracts4,Hard, +c,CERT-C,ERR30-C,Yes,Rule,,,"Take care when reading errno",M19-3-1,Contracts4,Hard, c,CERT-C,ERR32-C,Yes,Rule,,,Do not rely on indeterminate values of errno,,Contracts5,Hard, c,CERT-C,ERR33-C,Yes,Rule,,,Detect and handle standard library errors,MEM52-CPP,Contracts5,Hard, c,CERT-C,ERR34-C,OutOfScope,Rule,,,Detect errors when converting a string to a number,,,, @@ -703,7 +703,7 @@ c,MISRA-C-2012,RULE-15-3,Yes,Required,,,"Any label referenced by a goto statemen c,MISRA-C-2012,RULE-15-4,Yes,Advisory,,,There should be no more than one break or goto statement used to terminate any iteration statement,,Statements2,Medium, c,MISRA-C-2012,RULE-15-5,Yes,Advisory,,,A function should have a single point of exit at the end,,Statements5,Medium, c,MISRA-C-2012,RULE-15-6,Yes,Required,,,The body of an iteration-statement or a selection-statement shall be a compund-statement,M6-3-1,Statements3,Import, -c,MISRA-C-2012,RULE-15-7,Yes,Required,,,All if else if constructs shall be terminated with an else statement,M6-4-2,Statements3,Import, +c,MISRA-C-2012,RULE-15-7,Yes,Required,,,All if / else if constructs shall be terminated with an else statement,M6-4-2,Statements3,Import, c,MISRA-C-2012,RULE-16-1,Yes,Required,,,All switch statements shall be well-formed,M6-4-3,Statements3,Import, c,MISRA-C-2012,RULE-16-2,Yes,Required,,,A switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statement,M6-4-4,Statements1,Import, c,MISRA-C-2012,RULE-16-3,Yes,Required,,,An unconditional break statement shall terminate every switch-clause,M6-4-5,Statements1,Import, @@ -774,182 +774,182 @@ c,MISRA-C-2012,RULE-22-7,Yes,Required,,,The macro EOF shall only be compared wit c,MISRA-C-2012,RULE-22-8,Yes,Required,,,The value of errno shall be set to zero prior to a call to an errno-setting-function,ERR30-C,Contracts3,Medium, c,MISRA-C-2012,RULE-22-9,Yes,Required,,,The value of errno shall be tested against zero after calling an errno-setting-function,,Contracts3,Medium, c,MISRA-C-2012,RULE-22-10,Yes,Required,,,The value of errno shall only be tested when the last function to be called was an errno-setting-function,,Contracts3,Medium, -cpp,MISRA-C++-2023,RULE-0-0-1,Yes,Required,Decidable,Single Translation Unit,A function shall not contain unreachable statements,M0-1-1,,Medium, -cpp,MISRA-C++-2023,RULE-0-0-2,Yes,Advisory,Undecidable,System,Controlling expressions should not be invariant,M0-1-2,,Easy, -cpp,MISRA-C++-2023,RULE-0-1-1,Yes,Advisory,Undecidable,System,A value should not be unnecessarily written to a local object,A0-1-1,,Medium, -cpp,MISRA-C++-2023,RULE-0-1-2,Yes,Required,Decidable,Single Translation Unit,The value returned by a function shall be used,A0-1-2,,Easy, -cpp,MISRA-C++-2023,RULE-0-2-1,Yes,Advisory,Decidable,Single Translation Unit,Variables with limited visibility should be used at least once,M0-1-3,,Easy, -cpp,MISRA-C++-2023,RULE-0-2-2,Yes,Required,Decidable,Single Translation Unit,A named function parameter shall be used at least once,"A0-1-4, A0-1-5",,Easy, -cpp,MISRA-C++-2023,RULE-0-2-3,Yes,Advisory,Decidable,Single Translation Unit,Types with limited visibility should be used at least once,A0-1-6,,Easy, -cpp,MISRA-C++-2023,RULE-0-2-4,Yes,Advisory,Decidable,System,Functions with limited visibility should be used at least once,A0-1-3,,Easy, +cpp,MISRA-C++-2023,RULE-0-0-1,Yes,Required,Decidable,Single Translation Unit,A function shall not contain unreachable statements,,,Medium, +cpp,MISRA-C++-2023,RULE-0-0-2,Yes,Advisory,Undecidable,System,Controlling expressions should not be invariant,,,Easy, +cpp,MISRA-C++-2023,RULE-0-1-1,Yes,Advisory,Undecidable,System,A value should not be unnecessarily written to a local object,,,Medium, +cpp,MISRA-C++-2023,RULE-0-1-2,Yes,Required,Decidable,Single Translation Unit,The value returned by a function shall be used,,,Easy, +cpp,MISRA-C++-2023,RULE-0-2-1,Yes,Advisory,Decidable,Single Translation Unit,Variables with limited visibility should be used at least once,,,Easy, +cpp,MISRA-C++-2023,RULE-0-2-2,Yes,Required,Decidable,Single Translation Unit,A named function parameter shall be used at least once,,,Easy, +cpp,MISRA-C++-2023,RULE-0-2-3,Yes,Advisory,Decidable,Single Translation Unit,Types with limited visibility should be used at least once,,,Easy, +cpp,MISRA-C++-2023,RULE-0-2-4,Yes,Advisory,Decidable,System,Functions with limited visibility should be used at least once,,,Easy, cpp,MISRA-C++-2023,DIR-0-3-1,Yes,Advisory,,,Floating-point arithmetic should be used appropriately,,,Hard, cpp,MISRA-C++-2023,DIR-0-3-2,Yes,Required,,,A function call shall not violate the function’s preconditions,,,Hard, cpp,MISRA-C++-2023,RULE-4-1-1,Yes,Required,Undecidable,System,A program shall conform to ISO/IEC 14882:2017 (C++17),,,Hard, cpp,MISRA-C++-2023,RULE-4-1-2,Yes,Advisory,Decidable,Single Translation Unit,Deprecated features should not be used,,,Very Hard, cpp,MISRA-C++-2023,RULE-4-1-3,Yes,Required,Undecidable,System,There shall be no occurrence of undefined or critical unspecified behaviour,,,Very Hard, -cpp,MISRA-C++-2023,RULE-4-6-1,Yes,Required,Undecidable,System,Operations on a memory location shall be sequenced appropriately,RULE-13-2,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-5-0-1,Yes,Advisory,Decidable,Single Translation Unit,Trigraph-like sequences should not be used,A2-5-1,,Very Hard, -cpp,MISRA-C++-2023,RULE-5-7-1,Yes,Required,Decidable,Single Translation Unit,The character sequence /* shall not be used within a C-style comment,M2-7-1,ImportMisra23,Import, -cpp,MISRA-C++-2023,DIR-5-7-2,Yes,Advisory,,,Sections of code should not be “commented out”,A2-7-2,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-5-7-3,Yes,Required,Decidable,Single Translation Unit,Line-splicing shall not be used in // comments,A2-7-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-4-6-1,Yes,Required,Undecidable,System,Operations on a memory location shall be sequenced appropriately,,,Import, +cpp,MISRA-C++-2023,RULE-5-0-1,Yes,Advisory,Decidable,Single Translation Unit,Trigraph-like sequences should not be used,,,Very Hard, +cpp,MISRA-C++-2023,RULE-5-7-1,Yes,Required,Decidable,Single Translation Unit,The character sequence /* shall not be used within a C-style comment,,,Import, +cpp,MISRA-C++-2023,DIR-5-7-2,Yes,Advisory,,,Sections of code should not be “commented out”,,,Import, +cpp,MISRA-C++-2023,RULE-5-7-3,Yes,Required,Decidable,Single Translation Unit,Line-splicing shall not be used in // comments,,,Import, cpp,MISRA-C++-2023,RULE-5-10-1,Yes,Required,Decidable,Single Translation Unit,User-defined identifiers shall have an appropriate form,,,Easy, -cpp,MISRA-C++-2023,RULE-5-13-1,Yes,Required,Decidable,Single Translation Unit,"In character literals and non-raw string literals, \ shall only be used to form a defined escape sequence or universal character name",A2-13-1,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-5-13-2,Yes,Required,Decidable,Single Translation Unit,"Octal escape sequences, hexadecimal escape sequences, and universal character names shall be terminated",RULE-4-1,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-5-13-3,Yes,Required,Decidable,Single Translation Unit,Octal constants shall not be used,RULE-7-1,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-5-13-4,Yes,Required,Decidable,Single Translation Unit,Unsigned integer literals shall be appropriately suffixed,M2-13-3,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-5-13-5,Yes,Required,Decidable,Single Translation Unit,The lowercase form of L shall not be used as the first character in a literal suffix,RULE-7-3,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-5-13-1,Yes,Required,Decidable,Single Translation Unit,"In character literals and non-raw string literals, \ shall only be used to form a defined escape sequence or universal character name",,,Import, +cpp,MISRA-C++-2023,RULE-5-13-2,Yes,Required,Decidable,Single Translation Unit,"Octal escape sequences, hexadecimal escape sequences, and universal character names shall be terminated",,,Import, +cpp,MISRA-C++-2023,RULE-5-13-3,Yes,Required,Decidable,Single Translation Unit,Octal constants shall not be used,,,Import, +cpp,MISRA-C++-2023,RULE-5-13-4,Yes,Required,Decidable,Single Translation Unit,Unsigned integer literals shall be appropriately suffixed,,,Import, +cpp,MISRA-C++-2023,RULE-5-13-5,Yes,Required,Decidable,Single Translation Unit,The lowercase form of L shall not be used as the first character in a literal suffix,,,Import, cpp,MISRA-C++-2023,RULE-5-13-6,Yes,Required,Decidable,Single Translation Unit,An integer-literal of type long long shall not use a single L or l in any suffix,,,Easy, -cpp,MISRA-C++-2023,RULE-5-13-7,No,Required,Decidable,Single Translation Unit,String literals with different encoding prefixes shall not be concatenated,A2-13-2,,, -cpp,MISRA-C++-2023,RULE-6-0-1,Yes,Required,Decidable,Single Translation Unit,Block scope declarations shall not be visually ambiguous,"M3-1-2,DCL53-CPP",,Easy, -cpp,MISRA-C++-2023,RULE-6-0-2,Yes,Advisory,Decidable,Single Translation Unit,"When an array with external linkage is declared, its size should be explicitly specified",RULE-18-8,,Easy, -cpp,MISRA-C++-2023,RULE-6-0-3,Yes,Advisory,Decidable,Single Translation Unit,"The only declarations in the global namespace should be main, namespace declarations and extern ""C"" declarations",M7-3-1,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-6-0-4,Yes,Required,Decidable,Single Translation Unit,The identifier main shall not be used for a function other than the global function main,M7-3-2,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-6-2-1,Yes,Required,Decidable,System,The one-definition rule shall not be violated,M3-2-2,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-6-2-2,Yes,Required,Decidable,System,All declarations of a variable or function shall have the same type,"M3-9-1,DCL40-C",,Easy, +cpp,MISRA-C++-2023,RULE-5-13-7,No,Required,Decidable,Single Translation Unit,String literals with different encoding prefixes shall not be concatenated,,,, +cpp,MISRA-C++-2023,RULE-6-0-1,Yes,Required,Decidable,Single Translation Unit,Block scope declarations shall not be visually ambiguous,,,Easy, +cpp,MISRA-C++-2023,RULE-6-0-2,Yes,Advisory,Decidable,Single Translation Unit,"When an array with external linkage is declared, its size should be explicitly specified",,,Easy, +cpp,MISRA-C++-2023,RULE-6-0-3,Yes,Advisory,Decidable,Single Translation Unit,"The only declarations in the global namespace should be main, namespace declarations and extern ""C"" declarations",,,Import, +cpp,MISRA-C++-2023,RULE-6-0-4,Yes,Required,Decidable,Single Translation Unit,The identifier main shall not be used for a function other than the global function main,,,Import, +cpp,MISRA-C++-2023,RULE-6-2-1,Yes,Required,Decidable,System,The one-definition rule shall not be violated,,,Import, +cpp,MISRA-C++-2023,RULE-6-2-2,Yes,Required,Decidable,System,All declarations of a variable or function shall have the same type,,,Easy, cpp,MISRA-C++-2023,RULE-6-2-3,Yes,Required,Decidable,System,The source code used to implement an entity shall appear only once,,,Medium, cpp,MISRA-C++-2023,RULE-6-2-4,Yes,Required,Decidable,Single Translation Unit,A header file shall not contain definitions of functions or objects that are non-inline and have external linkage,,,Easy, -cpp,MISRA-C++-2023,RULE-6-4-1,Yes,Required,Decidable,Single Translation Unit,A variable declared in an inner scope shall not hide a variable declared in an outer scope,A2-10-1,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-6-4-2,Yes,Required,Decidable,Single Translation Unit,Derived classes shall not conceal functions that are inherited from their bases,A7-3-1,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-6-4-3,Yes,Required,Decidable,Single Translation Unit,A name that is present in a dependent base shall not be resolved by unqualified lookup,M14-6-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-6-4-1,Yes,Required,Decidable,Single Translation Unit,A variable declared in an inner scope shall not hide a variable declared in an outer scope,,,Import, +cpp,MISRA-C++-2023,RULE-6-4-2,Yes,Required,Decidable,Single Translation Unit,Derived classes shall not conceal functions that are inherited from their bases,,,Import, +cpp,MISRA-C++-2023,RULE-6-4-3,Yes,Required,Decidable,Single Translation Unit,A name that is present in a dependent base shall not be resolved by unqualified lookup,,,Import, cpp,MISRA-C++-2023,RULE-6-5-1,Yes,Advisory,Decidable,Single Translation Unit,A function or object with external linkage should be introduced in a header file,,,Medium, cpp,MISRA-C++-2023,RULE-6-5-2,Yes,Advisory,Decidable,Single Translation Unit,Internal linkage should be specified appropriately,,,Medium, cpp,MISRA-C++-2023,RULE-6-7-1,Yes,Required,Decidable,Single Translation Unit,Local variables shall not have static storage duration,,,Easy, cpp,MISRA-C++-2023,RULE-6-7-2,Yes,Required,Decidable,Single Translation Unit,Global variables shall not be used,,,Easy, -cpp,MISRA-C++-2023,RULE-6-8-1,Yes,Required,Undecidable,System,An object shall not be accessed outside of its lifetime,A3-8-1,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-6-8-2,Yes,Mandatory,Decidable,Single Translation Unit,A function must not return a reference or a pointer to a local variable with automatic storage duration,M7-5-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-6-8-1,Yes,Required,Undecidable,System,An object shall not be accessed outside of its lifetime,,,Import, +cpp,MISRA-C++-2023,RULE-6-8-2,Yes,Mandatory,Decidable,Single Translation Unit,A function must not return a reference or a pointer to a local variable with automatic storage duration,,,Import, cpp,MISRA-C++-2023,RULE-6-8-3,Yes,Required,Decidable,Single Translation Unit,An assignment operator shall not assign the address of an object with automatic storage duration to an object with a greater lifetime,,,Medium, cpp,MISRA-C++-2023,RULE-6-8-4,Yes,Advisory,Decidable,Single Translation Unit,Member functions returning references to their object should be refqualified appropriately,,,Medium, cpp,MISRA-C++-2023,RULE-6-9-1,Yes,Required,Decidable,Single Translation Unit,The same type aliases shall be used in all declarations of the same entity,,,Medium, -cpp,MISRA-C++-2023,RULE-6-9-2,Yes,Advisory,Decidable,Single Translation Unit,The names of the standard signed integer types and standard unsigned integer types should not be used,A3-9-1,,Easy, +cpp,MISRA-C++-2023,RULE-6-9-2,Yes,Advisory,Decidable,Single Translation Unit,The names of the standard signed integer types and standard unsigned integer types should not be used,,,Easy, cpp,MISRA-C++-2023,RULE-7-0-1,Yes,Required,Decidable,Single Translation Unit,There shall be no conversion from type bool,,,Easy, cpp,MISRA-C++-2023,RULE-7-0-2,Yes,Required,Decidable,Single Translation Unit,There shall be no conversion to type bool,,,Easy, -cpp,MISRA-C++-2023,RULE-7-0-3,Yes,Required,Decidable,Single Translation Unit,The numerical value of a character shall not be used,M5-0-11,,Medium, -cpp,MISRA-C++-2023,RULE-7-0-4,Yes,Required,Decidable,Single Translation Unit,The operands of bitwise operators and shift operators shall be appropriate,RULE-10-1,,Medium, -cpp,MISRA-C++-2023,RULE-7-0-5,Yes,Required,Decidable,Single Translation Unit,Integral promotion and the usual arithmetic conversions shall not change the signedness or the type category of an operand,"M5-0-4,M5-0-9,INT31-C",,Medium, +cpp,MISRA-C++-2023,RULE-7-0-3,Yes,Required,Decidable,Single Translation Unit,The numerical value of a character shall not be used,,,Medium, +cpp,MISRA-C++-2023,RULE-7-0-4,Yes,Required,Decidable,Single Translation Unit,The operands of bitwise operators and shift operators shall be appropriate,,,Medium, +cpp,MISRA-C++-2023,RULE-7-0-5,Yes,Required,Decidable,Single Translation Unit,Integral promotion and the usual arithmetic conversions shall not change the signedness or the type category of an operand,,,Medium, cpp,MISRA-C++-2023,RULE-7-0-6,Yes,Required,Decidable,Single Translation Unit,Assignment between numeric types shall be appropriate,,,Hard, -cpp,MISRA-C++-2023,RULE-7-11-1,Yes,Required,Decidable,Single Translation Unit,nullptr shall be the only form of the null-pointer-constant,A4-10-1,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-7-11-2,Yes,Required,Decidable,Single Translation Unit,An array passed as a function argument shall not decay to a pointer,M5-2-12,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-7-11-1,Yes,Required,Decidable,Single Translation Unit,nullptr shall be the only form of the null-pointer-constant,,,Import, +cpp,MISRA-C++-2023,RULE-7-11-2,Yes,Required,Decidable,Single Translation Unit,An array passed as a function argument shall not decay to a pointer,,,Import, cpp,MISRA-C++-2023,RULE-7-11-3,Yes,Required,Decidable,Single Translation Unit,A conversion from function type to pointer-to-function type shall only occur in appropriate contexts,,,Easy, -cpp,MISRA-C++-2023,RULE-8-0-1,Yes,Advisory,Decidable,Single Translation Unit,Parentheses should be used to make the meaning of an expression appropriately explicit,M5-0-2,,Medium, +cpp,MISRA-C++-2023,RULE-8-0-1,Yes,Advisory,Decidable,Single Translation Unit,Parentheses should be used to make the meaning of an expression appropriately explicit,,,Medium, cpp,MISRA-C++-2023,RULE-8-1-1,Yes,Required,Decidable,Single Translation Unit,A non-transient lambda shall not implicitly capture this,,,Easy, -cpp,MISRA-C++-2023,RULE-8-1-2,Yes,Advisory,Decidable,Single Translation Unit,Variables should be captured explicitly in a non-transient lambda,A5-1-2,,Easy, +cpp,MISRA-C++-2023,RULE-8-1-2,Yes,Advisory,Decidable,Single Translation Unit,Variables should be captured explicitly in a non-transient lambda,,,Easy, cpp,MISRA-C++-2023,RULE-8-2-1,Yes,Required,Decidable,Single Translation Unit,A virtual base class shall only be cast to a derived class by means of dynamic_cast,,,Easy, -cpp,MISRA-C++-2023,RULE-8-2-2,Yes,Required,Decidable,Single Translation Unit,C-style casts and functional notation casts shall not be used,A5-2-2,,Easy, -cpp,MISRA-C++-2023,RULE-8-2-3,Yes,Required,Decidable,Single Translation Unit,A cast shall not remove any const or volatile qualification from the type accessed via a pointer or by reference,A5-2-3,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-8-2-4,Yes,Required,Decidable,Single Translation Unit,Casts shall not be performed between a pointer to function and any other type,M5-2-6,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-8-2-5,Yes,Required,Decidable,Single Translation Unit,reinterpret_cast shall not be used,A5-2-4,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-8-2-6,Yes,Required,Decidable,Single Translation Unit,"An object with integral, enumerated, or pointer to void type shall not be cast to a pointer type","RULE-11-6, INT36-C",,Easy, -cpp,MISRA-C++-2023,RULE-8-2-7,Yes,Advisory,Decidable,Single Translation Unit,A cast should not convert a pointer type to an integral type,"RULE-11-6, INT36-C",,Easy, -cpp,MISRA-C++-2023,RULE-8-2-8,Yes,Required,Decidable,Single Translation Unit,An object pointer type shall not be cast to an integral type other than std::uintptr_t or std::intptr_t,"RULE-11-6, INT36-C",,Easy, +cpp,MISRA-C++-2023,RULE-8-2-2,Yes,Required,Decidable,Single Translation Unit,C-style casts and functional notation casts shall not be used,,,Easy, +cpp,MISRA-C++-2023,RULE-8-2-3,Yes,Required,Decidable,Single Translation Unit,A cast shall not remove any const or volatile qualification from the type accessed via a pointer or by reference,,,Import, +cpp,MISRA-C++-2023,RULE-8-2-4,Yes,Required,Decidable,Single Translation Unit,Casts shall not be performed between a pointer to function and any other type,,,Import, +cpp,MISRA-C++-2023,RULE-8-2-5,Yes,Required,Decidable,Single Translation Unit,reinterpret_cast shall not be used,,,Import, +cpp,MISRA-C++-2023,RULE-8-2-6,Yes,Required,Decidable,Single Translation Unit,"An object with integral, enumerated, or pointer to void type shall not be cast to a pointer type",,,Easy, +cpp,MISRA-C++-2023,RULE-8-2-7,Yes,Advisory,Decidable,Single Translation Unit,A cast should not convert a pointer type to an integral type,,,Easy, +cpp,MISRA-C++-2023,RULE-8-2-8,Yes,Required,Decidable,Single Translation Unit,An object pointer type shall not be cast to an integral type other than std::uintptr_t or std::intptr_t,,,Easy, cpp,MISRA-C++-2023,RULE-8-2-9,Yes,Required,Decidable,Single Translation Unit,The operand to typeid shall not be an expression of polymorphic class type,,,Easy, -cpp,MISRA-C++-2023,RULE-8-2-10,Yes,Required,Undecidable,System,"Functions shall not call themselves, either directly or indirectly",A7-5-2,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-8-2-10,Yes,Required,Undecidable,System,"Functions shall not call themselves, either directly or indirectly",,,Import, cpp,MISRA-C++-2023,RULE-8-2-11,Yes,Required,Decidable,Single Translation Unit,An argument passed via ellipsis shall have an appropriate type,,,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-1,Yes,Advisory,Decidable,Single Translation Unit,The built-in unary - operator should not be applied to an expression of unsigned type,,,Import, cpp,MISRA-C++-2023,RULE-8-3-2,Yes,Advisory,Decidable,Single Translation Unit,The built-in unary + operator should not be used,,,Easy, -cpp,MISRA-C++-2023,RULE-8-7-1,Yes,Required,Undecidable,System,Pointer arithmetic shall not form an invalid pointer,ARR30-C,,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,,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,,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",,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",,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,M15-8-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, -cpp,MISRA-C++-2023,RULE-9-2-1,Yes,Required,Decidable,Single Translation Unit,An explicit type conversion shall not be an expression statement,DCL53-CPP,,Easy, -cpp,MISRA-C++-2023,RULE-9-3-1,Yes,Required,Decidable,Single Translation Unit,The body of an iteration-statement or a selection-statement shall be a compound-statement,RULE-15-6,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-9-4-1,Yes,Required,Decidable,Single Translation Unit,All if ... else if constructs shall be terminated with an else statement,RULE-15-7,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-9-4-2,Yes,Required,Decidable,Single Translation Unit,The structure of a switch statement shall be appropriate,"RULE-16-1, RULE-16-2,RULE-16-3,RULE-16-4,RULE-16-5,RULE-16-6,RULE-16-7",,Medium, +cpp,MISRA-C++-2023,RULE-8-7-1,Yes,Required,Undecidable,System,Pointer arithmetic shall not form an invalid pointer,,,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,,,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",,,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,,,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,,,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,,,Import, +cpp,MISRA-C++-2023,RULE-8-19-1,Yes,Advisory,Decidable,Single Translation Unit,The comma operator should not be used,,,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,,,Import, +cpp,MISRA-C++-2023,RULE-9-2-1,Yes,Required,Decidable,Single Translation Unit,An explicit type conversion shall not be an expression statement,,,Easy, +cpp,MISRA-C++-2023,RULE-9-3-1,Yes,Required,Decidable,Single Translation Unit,The body of an iteration-statement or a selection-statement shall be a compound-statement,,,Import, +cpp,MISRA-C++-2023,RULE-9-4-1,Yes,Required,Decidable,Single Translation Unit,All if ... else if constructs shall be terminated with an else statement,,,Import, +cpp,MISRA-C++-2023,RULE-9-4-2,Yes,Required,Decidable,Single Translation Unit,The structure of a switch statement shall be appropriate,,,Medium, cpp,MISRA-C++-2023,RULE-9-5-1,Yes,Advisory,Decidable,Single Translation Unit,Legacy for statements should be simple,,,Hard, cpp,MISRA-C++-2023,RULE-9-5-2,Yes,Required,Decidable,Single Translation Unit,A for-range-initializer shall contain at most one function call,,,Easy, -cpp,MISRA-C++-2023,RULE-9-6-1,Yes,Advisory,Decidable,Single Translation Unit,The goto statement should not be used,RULE-15-1,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-9-6-2,Yes,Required,Decidable,Single Translation Unit,A goto statement shall reference a label in a surrounding block,RULE-15-3,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-9-6-3,Yes,Required,Decidable,Single Translation Unit,The goto statement shall jump to a label declared later in the function body,RULE-15-2,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-9-6-4,Yes,Required,Undecidable,System,A function declared with the [[noreturn]] attribute shall not return,MSC53-CPP,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-9-6-5,Yes,Required,Decidable,Single Translation Unit,A function with non-void return type shall return a value on all paths,MSC52-CPP,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-10-0-1,Yes,Advisory,Decidable,Single Translation Unit,A declaration should not declare more than one variable or member variable,M8-0-1,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-10-1-1,Yes,Advisory,Decidable,Single Translation Unit,The target type of a pointer or lvalue reference parameter should be const-qualified appropriately,RULE-8-13,,Hard, +cpp,MISRA-C++-2023,RULE-9-6-1,Yes,Advisory,Decidable,Single Translation Unit,The goto statement should not be used,,,Import, +cpp,MISRA-C++-2023,RULE-9-6-2,Yes,Required,Decidable,Single Translation Unit,A goto statement shall reference a label in a surrounding block,,,Import, +cpp,MISRA-C++-2023,RULE-9-6-3,Yes,Required,Decidable,Single Translation Unit,The goto statement shall jump to a label declared later in the function body,,,Import, +cpp,MISRA-C++-2023,RULE-9-6-4,Yes,Required,Undecidable,System,A function declared with the [[noreturn]] attribute shall not return,,,Import, +cpp,MISRA-C++-2023,RULE-9-6-5,Yes,Required,Decidable,Single Translation Unit,A function with non-void return type shall return a value on all paths,,,Import, +cpp,MISRA-C++-2023,RULE-10-0-1,Yes,Advisory,Decidable,Single Translation Unit,A declaration should not declare more than one variable or member variable,,,Import, +cpp,MISRA-C++-2023,RULE-10-1-1,Yes,Advisory,Decidable,Single Translation Unit,The target type of a pointer or lvalue reference parameter should be const-qualified appropriately,,,Hard, cpp,MISRA-C++-2023,RULE-10-1-2,Yes,Required,Decidable,Single Translation Unit,The volatile qualifier shall be used appropriately,,,Easy, -cpp,MISRA-C++-2023,RULE-10-2-1,Yes,Required,Decidable,Single Translation Unit,An enumeration shall be defined with an explicit underlying type,A7-2-2,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-10-2-2,Yes,Advisory,Decidable,Single Translation Unit,Unscoped enumerations should not be declared,A7-2-3,,Easy, -cpp,MISRA-C++-2023,RULE-10-2-3,Yes,Required,Decidable,Single Translation Unit,The numeric value of an unscoped enumeration with no fixed underlying type shall not be used,A4-5-1,,Easy, -cpp,MISRA-C++-2023,RULE-10-3-1,Yes,Advisory,Decidable,Single Translation Unit,There should be no unnamed namespaces in header files,"DCL59-CPP, M7-3-3",,Easy, -cpp,MISRA-C++-2023,RULE-10-4-1,Yes,Required,Decidable,Single Translation Unit,The asm declaration shall not be used,A7-4-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-10-2-1,Yes,Required,Decidable,Single Translation Unit,An enumeration shall be defined with an explicit underlying type,,,Import, +cpp,MISRA-C++-2023,RULE-10-2-2,Yes,Advisory,Decidable,Single Translation Unit,Unscoped enumerations should not be declared,,,Easy, +cpp,MISRA-C++-2023,RULE-10-2-3,Yes,Required,Decidable,Single Translation Unit,The numeric value of an unscoped enumeration with no fixed underlying type shall not be used,,,Easy, +cpp,MISRA-C++-2023,RULE-10-3-1,Yes,Advisory,Decidable,Single Translation Unit,There should be no unnamed namespaces in header files,,,Easy, +cpp,MISRA-C++-2023,RULE-10-4-1,Yes,Required,Decidable,Single Translation Unit,The asm declaration shall not be used,,,Import, cpp,MISRA-C++-2023,RULE-11-3-1,Yes,Advisory,Decidable,Single Translation Unit,Variables of array type should not be declared,,,Easy, -cpp,MISRA-C++-2023,RULE-11-3-2,Yes,Advisory,Decidable,Single Translation Unit,The declaration of an object should contain no more than two levels of pointer indirection,A5-0-3,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-11-3-2,Yes,Advisory,Decidable,Single Translation Unit,The declaration of an object should contain no more than two levels of pointer indirection,,,Import, cpp,MISRA-C++-2023,RULE-11-6-1,Yes,Advisory,Decidable,Single Translation Unit,All variables should be initialized,,,Easy, -cpp,MISRA-C++-2023,RULE-11-6-2,Yes,Mandatory,Undecidable,System,The value of an object must not be read before it has been set,A8-5-0,,Very Hard, -cpp,MISRA-C++-2023,RULE-11-6-3,Yes,Required,Decidable,Single Translation Unit,"Within an enumerator list, the value of an implicitly-specified enumeration constant shall be unique",RULE-8-12,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-12-2-1,Yes,Advisory,Decidable,Single Translation Unit,Bit-fields should not be declared,A9-6-2,,Easy, -cpp,MISRA-C++-2023,RULE-12-2-2,Yes,Required,Decidable,Single Translation Unit,A bit-field shall have an appropriate type,RULE-6-1,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-12-2-3,Yes,Required,Decidable,Single Translation Unit,A named bit-field with signed integer type shall not have a length of one bit,"RULE-6-2, M9-6-4",ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-12-3-1,Yes,Required,Decidable,Single Translation Unit,The union keyword shall not be used,RULE-19-2,,Easy, +cpp,MISRA-C++-2023,RULE-11-6-2,Yes,Mandatory,Undecidable,System,The value of an object must not be read before it has been set,,,Very Hard, +cpp,MISRA-C++-2023,RULE-11-6-3,Yes,Required,Decidable,Single Translation Unit,"Within an enumerator list, the value of an implicitly-specified enumeration constant shall be unique",,,Import, +cpp,MISRA-C++-2023,RULE-12-2-1,Yes,Advisory,Decidable,Single Translation Unit,Bit-fields should not be declared,,,Easy, +cpp,MISRA-C++-2023,RULE-12-2-2,Yes,Required,Decidable,Single Translation Unit,A bit-field shall have an appropriate type,,,Import, +cpp,MISRA-C++-2023,RULE-12-2-3,Yes,Required,Decidable,Single Translation Unit,A named bit-field with signed integer type shall not have a length of one bit,,,Import, +cpp,MISRA-C++-2023,RULE-12-3-1,Yes,Required,Decidable,Single Translation Unit,The union keyword shall not be used,,,Easy, cpp,MISRA-C++-2023,RULE-13-1-1,Yes,Advisory,Decidable,Single Translation Unit,Classes should not be inherited virtually,,,Easy, -cpp,MISRA-C++-2023,RULE-13-1-2,Yes,Required,Decidable,Single Translation Unit,An accessible base class shall not be both virtual and non-virtual in the same hierarchy,M10-1-3,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-13-1-2,Yes,Required,Decidable,Single Translation Unit,An accessible base class shall not be both virtual and non-virtual in the same hierarchy,,,Import, cpp,MISRA-C++-2023,RULE-13-3-1,Yes,Required,Decidable,Single Translation Unit,"User-declared member functions shall use the virtual, override and final specifiers appropriately",,,Easy, -cpp,MISRA-C++-2023,RULE-13-3-2,Yes,Required,Decidable,Single Translation Unit,Parameters in an overriding virtual function shall not specify different default arguments,M8-3-1,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-13-3-3,Yes,Required,Decidable,System,The parameters in all declarations or overrides of a function shall either be unnamed or have identical names,A15-1-2,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-13-3-4,Yes,Required,Decidable,Single Translation Unit,A comparison of a potentially virtual pointer to member function shall only be with nullptr,A5-10-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-13-3-2,Yes,Required,Decidable,Single Translation Unit,Parameters in an overriding virtual function shall not specify different default arguments,,,Import, +cpp,MISRA-C++-2023,RULE-13-3-3,Yes,Required,Decidable,System,The parameters in all declarations or overrides of a function shall either be unnamed or have identical names,,,Import, +cpp,MISRA-C++-2023,RULE-13-3-4,Yes,Required,Decidable,Single Translation Unit,A comparison of a potentially virtual pointer to member function shall only be with nullptr,,,Import, cpp,MISRA-C++-2023,RULE-14-1-1,Yes,Advisory,Decidable,Single Translation Unit,Non-static data members should be either all private or all public,,,Easy, -cpp,MISRA-C++-2023,RULE-15-0-1,Yes,Required,Decidable,Single Translation Unit,Special member functions shall be provided appropriately,A12-0-1,,Medium, +cpp,MISRA-C++-2023,RULE-15-0-1,Yes,Required,Decidable,Single Translation Unit,Special member functions shall be provided appropriately,,,Medium, cpp,MISRA-C++-2023,RULE-15-0-2,Yes,Advisory,Decidable,Single Translation Unit,User-provided copy and move member functions of a class should have appropriate signatures,,,Easy, -cpp,MISRA-C++-2023,RULE-15-1-1,Yes,Required,Undecidable,System,An object’s dynamic type shall not be used from within its constructor or destructor,M12-1-1,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-15-1-2,Yes,Advisory,Decidable,Single Translation Unit,All constructors of a class should explicitly initialize all of its virtual base classes and immediate base classes,A12-1-1,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-15-1-3,Yes,Required,Decidable,Single Translation Unit,Conversion operators and constructors that are callable with a single argument shall be explicit,"A12-1-4,A13-5-2",,Easy, +cpp,MISRA-C++-2023,RULE-15-1-1,Yes,Required,Undecidable,System,An object’s dynamic type shall not be used from within its constructor or destructor,,,Import, +cpp,MISRA-C++-2023,RULE-15-1-2,Yes,Advisory,Decidable,Single Translation Unit,All constructors of a class should explicitly initialize all of its virtual base classes and immediate base classes,,,Import, +cpp,MISRA-C++-2023,RULE-15-1-3,Yes,Required,Decidable,Single Translation Unit,Conversion operators and constructors that are callable with a single argument shall be explicit,,,Easy, cpp,MISRA-C++-2023,RULE-15-1-4,Yes,Advisory,Decidable,Single Translation Unit,"All direct, non-static data members of a class should be initialized before the class object is accessible",,,Hard, -cpp,MISRA-C++-2023,RULE-15-1-5,Yes,Required,Decidable,Single Translation Unit,A class shall only define an initializer-list constructor when it is the only constructor,A8-5-4,ImportMisra23,Import, -cpp,MISRA-C++-2023,DIR-15-8-1,Yes,Required,Decidable,Implementation,User-provided copy assignment operators and move assignment operators shall handle self-assignment,A12-8-5,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-16-5-1,Yes,Required,Decidable,Single Translation Unit,The logical AND and logical OR operators shall not be overloaded,M5-2-11,,Easy, -cpp,MISRA-C++-2023,RULE-16-5-2,Yes,Required,Decidable,Single Translation Unit,The address-of operator shall not be overloaded,M5-3-3,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-15-1-5,Yes,Required,Decidable,Single Translation Unit,A class shall only define an initializer-list constructor when it is the only constructor,,,Import, +cpp,MISRA-C++-2023,DIR-15-8-1,Yes,Required,#VALUE!,,User-provided copy assignment operators and move assignment operators shall handle self-assignment,,,Import, +cpp,MISRA-C++-2023,RULE-16-5-1,Yes,Required,Decidable,Single Translation Unit,The logical AND and logical OR operators shall not be overloaded,,,Easy, +cpp,MISRA-C++-2023,RULE-16-5-2,Yes,Required,Decidable,Single Translation Unit,The address-of operator shall not be overloaded,,,Import, cpp,MISRA-C++-2023,RULE-16-6-1,Yes,Advisory,Decidable,Single Translation Unit,Symmetrical operators should only be implemented as non-member functions,,,Medium, -cpp,MISRA-C++-2023,RULE-17-8-1,Yes,Required,Decidable,Single Translation Unit,Function templates shall not be explicitly specialized,A14-8-2,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-18-1-1,Yes,Required,Decidable,Single Translation Unit,An exception object shall not have pointer type,A15-1-2,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-18-1-2,Yes,Required,Decidable,Single Translation Unit,An empty throw shall only occur within the compound-statement of a catch handler,M15-1-3,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-18-3-1,Yes,Advisory,Decidable,Single Translation Unit,There should be at least one exception handler to catch all otherwise unhandled exceptions,A15-3-3,,Easy, -cpp,MISRA-C++-2023,RULE-18-3-2,Yes,Required,Decidable,Single Translation Unit,An exception of class type shall be caught by const reference or reference,A15-3-5,,Easy, -cpp,MISRA-C++-2023,RULE-18-3-3,Yes,Required,Decidable,Single Translation Unit,Handlers for a function-try-block of a constructor or destructor shall not refer to non-static members from their class or its bases,M15-3-3,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-18-4-1,Yes,Required,Decidable,Single Translation Unit,Exception-unfriendly functions shall be noexcept,A15-5-1,,Easy, -cpp,MISRA-C++-2023,RULE-18-5-1,Yes,Advisory,Undecidable,System,A noexcept function should not attempt to propagate an exception to the calling function,A15-4-2,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-17-8-1,Yes,Required,Decidable,Single Translation Unit,Function templates shall not be explicitly specialized,,,Import, +cpp,MISRA-C++-2023,RULE-18-1-1,Yes,Required,Decidable,Single Translation Unit,An exception object shall not have pointer type,,,Import, +cpp,MISRA-C++-2023,RULE-18-1-2,Yes,Required,Decidable,Single Translation Unit,An empty throw shall only occur within the compound-statement of a catch handler,,,Import, +cpp,MISRA-C++-2023,RULE-18-3-1,Yes,Advisory,Decidable,Single Translation Unit,There should be at least one exception handler to catch all otherwise unhandled exceptions,,,Easy, +cpp,MISRA-C++-2023,RULE-18-3-2,Yes,Required,Decidable,Single Translation Unit,An exception of class type shall be caught by const reference or reference,,,Easy, +cpp,MISRA-C++-2023,RULE-18-3-3,Yes,Required,Decidable,Single Translation Unit,Handlers for a function-try-block of a constructor or destructor shall not refer to non-static members from their class or its bases,,,Import, +cpp,MISRA-C++-2023,RULE-18-4-1,Yes,Required,Decidable,Single Translation Unit,Exception-unfriendly functions shall be noexcept,,,Easy, +cpp,MISRA-C++-2023,RULE-18-5-1,Yes,Advisory,Undecidable,System,A noexcept function should not attempt to propagate an exception to the calling function,,,Import, cpp,MISRA-C++-2023,RULE-18-5-2,Yes,Advisory,Decidable,Single Translation Unit,Program-terminating functions should not be used,,,Easy, cpp,MISRA-C++-2023,RULE-19-0-1,No,Required,Decidable,Single Translation Unit,A line whose first token is # shall be a valid preprocessing directive,,,, -cpp,MISRA-C++-2023,RULE-19-0-2,Yes,Required,Decidable,Single Translation Unit,Function-like macros shall not be defined,DIR-4-9,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-19-0-3,Yes,Advisory,Decidable,Single Translation Unit,#include directives should only be preceded by preprocessor directives or comments,RULE-20-1,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-19-0-2,Yes,Required,Decidable,Single Translation Unit,Function-like macros shall not be defined,,,Import, +cpp,MISRA-C++-2023,RULE-19-0-3,Yes,Advisory,Decidable,Single Translation Unit,#include directives should only be preceded by preprocessor directives or comments,,,Import, cpp,MISRA-C++-2023,RULE-19-0-4,Yes,Advisory,Decidable,Single Translation Unit,#undef should only be used for macros defined previously in the same file,,,Easy, -cpp,MISRA-C++-2023,RULE-19-1-1,Yes,Required,Decidable,Single Translation Unit,The defined preprocessor operator shall be used appropriately,M16-1-1,,Easy, -cpp,MISRA-C++-2023,RULE-19-1-2,No,Required,Decidable,Single Translation Unit,"All #else, #elif and #endif preprocessor directives shall reside in the same file as the #if, #ifdef or #ifndef directive to which they are related",M16-1-2,,, -cpp,MISRA-C++-2023,RULE-19-1-3,Yes,Required,Decidable,Single Translation Unit,All identifiers used in the controlling expression of #if or #elif preprocessing directives shall be defined prior to evaluation,M16-0-7,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-19-2-1,Yes,Required,Decidable,Single Translation Unit,Precautions shall be taken in order to prevent the contents of a header file being included more than once,M16-2-3,,Easy, +cpp,MISRA-C++-2023,RULE-19-1-1,Yes,Required,Decidable,Single Translation Unit,The defined preprocessor operator shall be used appropriately,,,Easy, +cpp,MISRA-C++-2023,RULE-19-1-2,No,Required,Decidable,Single Translation Unit,"All #else, #elif and #endif preprocessor directives shall reside in the same file as the #if, #ifdef or #ifndef directive to which they are related",,,, +cpp,MISRA-C++-2023,RULE-19-1-3,Yes,Required,Decidable,Single Translation Unit,All identifiers used in the controlling expression of #if or #elif preprocessing directives shall be defined prior to evaluation,,,Import, +cpp,MISRA-C++-2023,RULE-19-2-1,Yes,Required,Decidable,Single Translation Unit,Precautions shall be taken in order to prevent the contents of a header file being included more than once,,,Easy, cpp,MISRA-C++-2023,RULE-19-2-2,Yes,Required,Decidable,Single Translation Unit,"The #include directive shall be followed by either a or ""filename"" sequence",,,Easy, -cpp,MISRA-C++-2023,RULE-19-2-3,Yes,Required,Decidable,Single Translation Unit,"The ' or "" or \ characters and the /* or // character sequences shall not occur in a header file name",A16-2-1,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-19-3-1,Yes,Advisory,Decidable,Single Translation Unit,The # and ## preprocessor operators should not be used,M16-3-2,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-19-3-2,Yes,Required,Decidable,Single Translation Unit,A macro parameter immediately following a # operator shall not be immediately followed by a ## operator,RULE-20-11,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-19-3-3,Yes,Required,Decidable,Single Translation Unit,The argument to a mixed-use macro parameter shall not be subject to further expansion,RULE-20-12,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-19-3-4,Yes,Required,Decidable,Single Translation Unit,Parentheses shall be used to ensure macro arguments are expanded appropriately,M16-0-6,,Medium, -cpp,MISRA-C++-2023,RULE-19-3-5,Yes,Required,Decidable,Single Translation Unit,Tokens that look like a preprocessing directive shall not occur within a macro argument,RULE-20-6,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-19-6-1,Yes,Advisory,Decidable,Single Translation Unit,The #pragma directive and the _Pragma operator should not be used,A16-7-1,,Easy, -cpp,MISRA-C++-2023,RULE-21-2-1,Yes,Required,Decidable,Single Translation Unit,"The library functions atof, atoi, atol and atoll from shall not be used",RULE-21-7,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-21-2-2,Yes,Required,Decidable,Single Translation Unit,"The string handling functions from , , and shall not be used",M18-0-5,,Easy, -cpp,MISRA-C++-2023,RULE-21-2-3,Yes,Required,Decidable,Single Translation Unit,The library function system from shall not be used,M18-0-3,,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,,Easy, +cpp,MISRA-C++-2023,RULE-19-2-3,Yes,Required,Decidable,Single Translation Unit,"The ' or "" or \ characters and the /* or // character sequences shall not occur in a header file name",,,Import, +cpp,MISRA-C++-2023,RULE-19-3-1,Yes,Advisory,Decidable,Single Translation Unit,The # and ## preprocessor operators should not be used,,,Import, +cpp,MISRA-C++-2023,RULE-19-3-2,Yes,Required,Decidable,Single Translation Unit,A macro parameter immediately following a # operator shall not be immediately followed by a ## operator,,,Import, +cpp,MISRA-C++-2023,RULE-19-3-3,Yes,Required,Decidable,Single Translation Unit,The argument to a mixed-use macro parameter shall not be subject to further expansion,,,Import, +cpp,MISRA-C++-2023,RULE-19-3-4,Yes,Required,Decidable,Single Translation Unit,Parentheses shall be used to ensure macro arguments are expanded appropriately,,,Medium, +cpp,MISRA-C++-2023,RULE-19-3-5,Yes,Required,Decidable,Single Translation Unit,Tokens that look like a preprocessing directive shall not occur within a macro argument,,,Import, +cpp,MISRA-C++-2023,RULE-19-6-1,Yes,Advisory,Decidable,Single Translation Unit,The #pragma directive and the _Pragma operator should not be used,,,Easy, +cpp,MISRA-C++-2023,RULE-21-2-1,Yes,Required,Decidable,Single Translation Unit,"The library functions atof, atoi, atol and atoll from shall not be used",,,Import, +cpp,MISRA-C++-2023,RULE-21-2-2,Yes,Required,Decidable,Single Translation Unit,"The string handling functions from , , and shall not be used",,,Easy, +cpp,MISRA-C++-2023,RULE-21-2-3,Yes,Required,Decidable,Single Translation Unit,The library function system from shall not be used,,,Easy, +cpp,MISRA-C++-2023,RULE-21-2-4,Yes,Required,Decidable,Single Translation Unit,The macro offsetof shall not be used,,,Import, +cpp,MISRA-C++-2023,RULE-21-6-1,Yes,Advisory,Undecidable,Single Translation Unit,Dynamic memory should not be used,,,Easy, cpp,MISRA-C++-2023,RULE-21-6-2,Yes,Required,Decidable,Single Translation Unit,Dynamic memory shall be managed automatically,,,Easy, cpp,MISRA-C++-2023,RULE-21-6-3,Yes,Required,Decidable,Single Translation Unit,Advanced memory management shall not be used,,,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 shall not be used,DCL50-CPP,,Easy, -cpp,MISRA-C++-2023,RULE-21-10-2,Yes,Required,Decidable,Single Translation Unit,The standard header file shall not be used,ERR52-CPP,,Easy, -cpp,MISRA-C++-2023,RULE-21-10-3,Yes,Required,Decidable,Single Translation Unit,The facilities provided by the standard header file shall not be used,M18-7-1,ImportMisra23,Import, +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",,,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,,,Import, +cpp,MISRA-C++-2023,RULE-21-10-1,Yes,Required,Decidable,Single Translation Unit,The features of shall not be used,,,Easy, +cpp,MISRA-C++-2023,RULE-21-10-2,Yes,Required,Decidable,Single Translation Unit,The standard header file shall not be used,,,Easy, +cpp,MISRA-C++-2023,RULE-21-10-3,Yes,Required,Decidable,Single Translation Unit,The facilities provided by the standard header file shall not be used,,,Import, cpp,MISRA-C++-2023,RULE-22-3-1,Yes,Required,Decidable,Single Translation Unit,The assert macro shall not be used with a constant-expression,,,Easy, cpp,MISRA-C++-2023,RULE-22-4-1,Yes,Required,Decidable,Single Translation Unit,The literal value zero shall be the only value assigned to errno,,,Easy, cpp,MISRA-C++-2023,RULE-23-11-1,Yes,Advisory,Decidable,Single Translation Unit,The raw pointer constructors of std::shared_ptr and std::unique_ptr should not be used,,,Easy, cpp,MISRA-C++-2023,RULE-24-5-1,Yes,Required,Decidable,Single Translation Unit,The character handling functions from and shall not be used,,,Easy, cpp,MISRA-C++-2023,RULE-24-5-2,Yes,Required,Decidable,Single Translation Unit,"The C++ Standard Library functions memcpy, memmove and memcmp from shall not be used",,,Easy, cpp,MISRA-C++-2023,RULE-25-5-1,Yes,Required,Decidable,Single Translation Unit,The setlocale and std::locale::global functions shall not be called,,,Easy, -cpp,MISRA-C++-2023,RULE-25-5-2,Yes,Mandatory,Decidable,Single Translation Unit,"The pointers returned by the C++ Standard Library functions localeconv, getenv, setlocale or strerror must only be used as if they have pointer to const-qualified type",RULE-21-19,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-25-5-3,Yes,Mandatory,Undecidable,System,"The pointer returned by the C++ Standard Library functions asctime, ctime, gmtime, localtime, localeconv, getenv, setlocale or strerror must not be used following a subsequent call to the same function",RULE-21-20,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-26-3-1,Yes,Advisory,Decidable,Single Translation Unit,std::vector should not be specialized with bool,A18-1-2,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-28-3-1,Yes,Required,Undecidable,System,Predicates shall not have persistent side effects,A25-1-1,,Easy, -cpp,MISRA-C++-2023,RULE-28-6-1,Yes,Required,Decidable,Single Translation Unit,The argument to std::move shall be a non-const lvalue,A18-9-3,,Easy, -cpp,MISRA-C++-2023,RULE-28-6-2,Yes,Required,Decidable,Single Translation Unit,Forwarding references and std::forward shall be used together,A18-9-2,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-28-6-3,Yes,Required,Decidable,Single Translation Unit,An object shall not be used while in a potentially moved-from state,A12-8-3,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-25-5-2,Yes,Mandatory,Decidable,Single Translation Unit,"The pointers returned by the C++ Standard Library functions localeconv, getenv, setlocale or strerror must only be used as if they have pointer to const-qualified type",,,Import, +cpp,MISRA-C++-2023,RULE-25-5-3,Yes,Mandatory,Undecidable,System,"The pointer returned by the C++ Standard Library functions asctime, ctime, gmtime, localtime, localeconv, getenv, setlocale or strerror must not be used following a subsequent call to the same function",,,Import, +cpp,MISRA-C++-2023,RULE-26-3-1,Yes,Advisory,Decidable,Single Translation Unit,std::vector should not be specialized with bool,,,Import, +cpp,MISRA-C++-2023,RULE-28-3-1,Yes,Required,Undecidable,System,Predicates shall not have persistent side effects,,,Easy, +cpp,MISRA-C++-2023,RULE-28-6-1,Yes,Required,Decidable,Single Translation Unit,The argument to std::move shall be a non-const lvalue,,,Easy, +cpp,MISRA-C++-2023,RULE-28-6-2,Yes,Required,Decidable,Single Translation Unit,Forwarding references and std::forward shall be used together,,,Import, +cpp,MISRA-C++-2023,RULE-28-6-3,Yes,Required,Decidable,Single Translation Unit,An object shall not be used while in a potentially moved-from state,,,Import, cpp,MISRA-C++-2023,RULE-28-6-4,Yes,Required,Decidable,Single Translation Unit,"The result of std::remove, std::remove_if, std::unique and empty shall be used",,,Easy, -cpp,MISRA-C++-2023,RULE-30-0-1,Yes,Required,Decidable,Single Translation Unit,The C Library input/output functions shall not be used,M27-0-1,ImportMisra23,Import, -cpp,MISRA-C++-2023,RULE-30-0-2,Yes,Required,Undecidable,System,Reads and writes on the same file stream shall be separated by a positioning operation,A27-0-3,ImportMisra23,Import, +cpp,MISRA-C++-2023,RULE-30-0-1,Yes,Required,Decidable,Single Translation Unit,The C Library input/output functions shall not be used,,,Import, +cpp,MISRA-C++-2023,RULE-30-0-2,Yes,Required,Undecidable,System,Reads and writes on the same file stream shall be separated by a positioning operation,,,Import, \ No newline at end of file From a98aea3b442f594fe90a1ae3fa4b152a926caec9 Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Fri, 21 Jun 2024 14:57:58 +0200 Subject: [PATCH 7/7] Create 2024-06-21-misra-cpp-2023-support.md --- change_notes/2024-06-21-misra-cpp-2023-support.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 change_notes/2024-06-21-misra-cpp-2023-support.md diff --git a/change_notes/2024-06-21-misra-cpp-2023-support.md b/change_notes/2024-06-21-misra-cpp-2023-support.md new file mode 100644 index 0000000000..e314d447fa --- /dev/null +++ b/change_notes/2024-06-21-misra-cpp-2023-support.md @@ -0,0 +1,2 @@ +- `MISRA C++ 2023`: + - Extend the project structure and provide initial support for query writing.