Skip to content

Commit 26a444d

Browse files
mbaludaCopilot
andcommitted
Prepare MISRA C:2025 development with end-to-end examples
Update the MISRA C suites, example queries, and reporting for the 2025 edition while retaining older-edition support. Apply guideline recategorizations only to queries whose default category permits the transition. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent bc8a0eb commit 26a444d

99 files changed

Lines changed: 1273 additions & 210 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/tooling-unit-tests.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,10 @@ jobs:
116116

117117
- name: Run PyTest
118118
run: |
119-
pytest scripts/release/update_release_assets_test.py
119+
pytest scripts/release/update_release_assets_test.py \
120+
scripts/release/create_supported_rules_list_test.py \
121+
scripts/verify_rule_package_consistency_test.py
122+
123+
- name: Run matrix tooling regression tests
124+
shell: pwsh
125+
run: ./scripts/matrix_testing/Get-TestFile.Tests.ps1
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
- description: MISRA C 2023 - Third Edition, Second Revision
2+
- qlpack: codeql/misra-c-coding-standards
3+
- include:
4+
kind:
5+
- problem
6+
- path-problem
7+
tags contain:
8+
- external/misra/c/2012/third-edition-first-revision
9+
- external/misra/c/2012/amendment2
10+
- external/misra/c/2012/amendment3
11+
- external/misra/c/2012/amendment4
12+
- exclude:
13+
tags contain:
14+
- external/misra/audit
15+
- external/misra/strict
16+
- external/misra/default-disabled

‎c/misra/src/codeql-suites/misra-c-advisory.qls‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- description: MISRA C 2023 (Advisory)
1+
- description: MISRA C 2025 (Advisory)
22
- qlpack: codeql/misra-c-coding-standards
33
- include:
44
kind:
@@ -9,4 +9,6 @@
99
- exclude:
1010
tags contain:
1111
- external/misra/audit
12+
- external/misra/strict
1213
- external/misra/default-disabled
14+
- external/misra/legacy
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
- description: MISRA C 2023 (Audit)
1+
- description: MISRA C 2025 (Audit)
22
- qlpack: codeql/misra-c-coding-standards
33
- include:
44
kind:
55
- problem
66
- path-problem
77
tags contain:
8-
- external/misra/c/audit
8+
- external/misra/audit
9+
- exclude:
10+
tags contain:
11+
- external/misra/legacy

‎c/misra/src/codeql-suites/misra-c-default.qls‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- description: MISRA C 2023 (Default)
1+
- description: MISRA C 2025 (Default)
22
- qlpack: codeql/misra-c-coding-standards
33
- include:
44
kind:
@@ -9,3 +9,4 @@
99
- external/misra/audit
1010
- external/misra/strict
1111
- external/misra/default-disabled
12+
- external/misra/legacy

‎c/misra/src/codeql-suites/misra-c-mandatory.qls‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- description: MISRA C 2023 (Advisory)
1+
- description: MISRA C 2025 (Mandatory)
22
- qlpack: codeql/misra-c-coding-standards
33
- include:
44
kind:
@@ -9,4 +9,6 @@
99
- exclude:
1010
tags contain:
1111
- external/misra/audit
12+
- external/misra/strict
1213
- external/misra/default-disabled
14+
- external/misra/legacy

‎c/misra/src/codeql-suites/misra-c-required.qls‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- description: MISRA C 2023 (Required)
1+
- description: MISRA C 2025 (Required)
22
- qlpack: codeql/misra-c-coding-standards
33
- include:
44
kind:
@@ -9,4 +9,6 @@
99
- exclude:
1010
tags contain:
1111
- external/misra/audit
12+
- external/misra/strict
1213
- external/misra/default-disabled
14+
- external/misra/legacy
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
- description: MISRA C 2023 (Strict)
1+
- description: MISRA C 2025 (Strict)
22
- qlpack: codeql/misra-c-coding-standards
33
- include:
44
kind:
55
- problem
66
- path-problem
77
tags contain:
88
- external/misra/strict
9+
- exclude:
10+
tags contain:
11+
- external/misra/legacy
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
- description: "DEPRECATED - MISRA C 2012 - use misra-c-default.qls instead"
1+
- description: "DEPRECATED - MISRA C 2025 - use misra-c-default.qls instead"
22
- import: codeql-suites/misra-c-default.qls
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/** Provides the reserved-macro detector shared by MISRA C guideline identities. */
2+
3+
import cpp
4+
import codingstandards.cpp.Naming
5+
6+
/** Gets a reserved name defined or undefined by `directive`. */
7+
string getReservedMacroName(PreprocessorDirective directive) {
8+
(
9+
directive.(Macro).hasName(result)
10+
or
11+
directive.(PreprocessorUndef).getName() = result
12+
) and
13+
(
14+
Naming::Cpp14::hasStandardLibraryMacroName(result)
15+
or
16+
Naming::Cpp14::hasStandardLibraryObjectName(result)
17+
or
18+
result.regexpMatch("_.*")
19+
or
20+
result = "defined"
21+
)
22+
}

0 commit comments

Comments
 (0)