Skip to content

Commit 301d133

Browse files
authored
Merge branch 'main' into fix-issue-629
2 parents 98c7610 + 373b793 commit 301d133

File tree

69 files changed

+1111
-118
lines changed

Some content is hidden

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

69 files changed

+1111
-118
lines changed

Diff for: .github/dependabot.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
# Check for updates to GitHub Actions every week
8+
interval: "weekly"

Diff for: .github/workflows/code-scanning-pack-gen.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
- name: Cache CodeQL
4848
id: cache-codeql
49-
uses: actions/cache@v2.1.3
49+
uses: actions/cache@v4
5050
with:
5151
path: ${{ github.workspace }}/codeql_home
5252
key: codeql-home-${{ matrix.os }}-${{ matrix.codeql_cli }}-${{ matrix.codeql_standard_library }}

Diff for: .github/workflows/codeql_unit_tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
uses: actions/checkout@v4
4949

5050
- name: Install Python
51-
uses: actions/setup-python@v4
51+
uses: actions/setup-python@v5
5252
with:
5353
python-version: "3.9"
5454

@@ -57,7 +57,7 @@ jobs:
5757

5858
- name: Cache CodeQL
5959
id: cache-codeql
60-
uses: actions/cache@v3
60+
uses: actions/cache@v4
6161
with:
6262
# A list of files, directories, and wildcard patterns to cache and restore
6363
path: ${{github.workspace}}/codeql_home

Diff for: .github/workflows/extra-rule-validation.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ubuntu-22.04
2222
steps:
2323
- name: Checkout
24-
uses: actions/checkout@v2
24+
uses: actions/checkout@v4
2525

2626
- name: Check Rules
2727
shell: pwsh
@@ -33,7 +33,7 @@ jobs:
3333
runs-on: ubuntu-22.04
3434
steps:
3535
- name: Checkout
36-
uses: actions/checkout@v2
36+
uses: actions/checkout@v4
3737

3838
- name: Ensure CPP Shared Rules Have Valid Structure
3939
shell: pwsh
@@ -44,13 +44,13 @@ jobs:
4444
run: scripts/util/Test-SharedImplementationsHaveTestCases.ps1 -Language c -CIMode
4545

4646

47-
- uses: actions/upload-artifact@v3
47+
- uses: actions/upload-artifact@v4
4848
if: failure()
4949
with:
5050
name: missing-test-report.csv
5151
path: MissingTestReport*.csv
5252

53-
- uses: actions/upload-artifact@v3
53+
- uses: actions/upload-artifact@v4
5454
if: failure()
5555
with:
5656
name: test-report.csv

Diff for: .github/workflows/finalize-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
path: tooling
5353

5454
- name: Install Python
55-
uses: actions/setup-python@v4
55+
uses: actions/setup-python@v5
5656
with:
5757
python-version: "3.9"
5858

Diff for: .github/workflows/generate-html-docs.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
runs-on: ubuntu-22.04
2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@v2
23+
uses: actions/checkout@v4
2424

2525
- name: Install Python
26-
uses: actions/setup-python@v4
26+
uses: actions/setup-python@v5
2727
with:
2828
python-version: "3.9"
2929

@@ -35,7 +35,7 @@ jobs:
3535
python scripts/documentation/generate_iso26262_docs.py coding-standards-html-docs
3636
3737
- name: Upload HTML documentation
38-
uses: actions/upload-artifact@v3
38+
uses: actions/upload-artifact@v4
3939
with:
4040
name: coding-standards-docs-${{ github.sha }}
4141
path: coding-standards-html-docs/

Diff for: .github/workflows/prepare-release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ jobs:
3434
runs-on: ubuntu-22.04
3535
steps:
3636
- name: Checkout
37-
uses: actions/checkout@v3
37+
uses: actions/checkout@v4
3838
with:
3939
ref: ${{ inputs.ref }}
4040

4141
- name: Install Python
42-
uses: actions/setup-python@v4
42+
uses: actions/setup-python@v5
4343
with:
4444
python-version: "3.9"
4545

Diff for: .github/workflows/standard_library_upgrade_tests.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
matrix: ${{ steps.export-unit-test-matrix.outputs.matrix }}
2020
steps:
2121
- name: Checkout repository
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v4
2323

2424
- name: Export unit test matrix
2525
id: export-unit-test-matrix
@@ -41,16 +41,16 @@ jobs:
4141

4242
steps:
4343
- name: Checkout repository
44-
uses: actions/checkout@v2
44+
uses: actions/checkout@v4
4545

4646
- name: Setup Python 3
47-
uses: actions/setup-python@v2
47+
uses: actions/setup-python@v5
4848
with:
4949
python-version: "3.x"
5050

5151
- name: Cache CodeQL
5252
id: cache-codeql
53-
uses: actions/cache@v2.1.3
53+
uses: actions/cache@v4
5454
with:
5555
# A list of files, directories, and wildcard patterns to cache and restore
5656
path: ${{github.workspace}}/codeql_home
@@ -157,7 +157,7 @@ jobs:
157157
runs-on: ubuntu-22.04
158158
steps:
159159
- name: Install Python
160-
uses: actions/setup-python@v4
160+
uses: actions/setup-python@v5
161161
with:
162162
python-version: "3.9"
163163

Diff for: .github/workflows/tooling-unit-tests.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
matrix: ${{ steps.export-supported-codeql-env-matrix.outputs.matrix }}
2323
steps:
2424
- name: Checkout repository
25-
uses: actions/checkout@v2
25+
uses: actions/checkout@v4
2626

2727
- name: Export supported CodeQL environment matrix
2828
id: export-supported-codeql-env-matrix
@@ -40,10 +40,10 @@ jobs:
4040
matrix: ${{ fromJSON(needs.prepare-supported-codeql-env-matrix.outputs.matrix) }}
4141
steps:
4242
- name: Checkout
43-
uses: actions/checkout@v2
43+
uses: actions/checkout@v4
4444

4545
- name: Install Python
46-
uses: actions/setup-python@v4
46+
uses: actions/setup-python@v5
4747
with:
4848
python-version: "3.9"
4949

@@ -52,7 +52,7 @@ jobs:
5252

5353
- name: Cache CodeQL
5454
id: cache-codeql
55-
uses: actions/cache@v2.1.3
55+
uses: actions/cache@v4
5656
with:
5757
path: ${{ github.workspace }}/codeql_home
5858
key: codeql-home-${{ matrix.os }}-${{ matrix.codeql_cli }}-${{ matrix.codeql_standard_library }}
@@ -83,10 +83,10 @@ jobs:
8383
runs-on: ubuntu-22.04
8484
steps:
8585
- name: Checkout
86-
uses: actions/checkout@v2
86+
uses: actions/checkout@v4
8787

8888
- name: Install Python
89-
uses: actions/setup-python@v4
89+
uses: actions/setup-python@v5
9090
with:
9191
python-version: "3.9"
9292

@@ -102,10 +102,10 @@ jobs:
102102
runs-on: ubuntu-22.04
103103
steps:
104104
- name: Checkout
105-
uses: actions/checkout@v2
105+
uses: actions/checkout@v4
106106

107107
- name: Install Python
108-
uses: actions/setup-python@v4
108+
uses: actions/setup-python@v5
109109
with:
110110
python-version: "3.9"
111111

Diff for: .github/workflows/update-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
ref: ${{ inputs.head-sha }}
3535

3636
- name: Install Python
37-
uses: actions/setup-python@v4
37+
uses: actions/setup-python@v5
3838
with:
3939
python-version: "3.9"
4040

Diff for: .github/workflows/validate-package-files.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ jobs:
1616
runs-on: ubuntu-22.04
1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020
with:
2121
ref: ${{ inputs.ref }}
2222

2323
- name: Install Python
24-
uses: actions/setup-python@v4
24+
uses: actions/setup-python@v5
2525
with:
2626
python-version: "3.9"
2727

Diff for: .github/workflows/validate-query-formatting.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-22.04
2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
2323
with:
2424
ref: ${{ inputs.ref }}
2525

Diff for: .github/workflows/validate-query-help.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-22.04
1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020
with:
2121
ref: ${{ inputs.ref }}
2222

Diff for: .github/workflows/validate-query-test-case-formatting.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
fail-fast: false
2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2424
with:
2525
ref: ${{ inputs.ref }}
2626

Diff for: .github/workflows/verify-standard-library-dependencies.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
matrix: ${{ steps.export-matrix.outputs.matrix }}
2323
steps:
2424
- name: Checkout repository
25-
uses: actions/checkout@v2
25+
uses: actions/checkout@v4
2626

2727
- name: Export unit test matrix
2828
id: export-matrix
@@ -44,16 +44,16 @@ jobs:
4444

4545
steps:
4646
- name: Checkout repository
47-
uses: actions/checkout@v2
47+
uses: actions/checkout@v4
4848

4949
- name: Setup Python 3
50-
uses: actions/setup-python@v4
50+
uses: actions/setup-python@v5
5151
with:
5252
python-version: "3.9"
5353

5454
- name: Cache CodeQL
5555
id: cache-codeql
56-
uses: actions/cache@v2.1.3
56+
uses: actions/cache@v4
5757
with:
5858
# A list of files, directories, and wildcard patterns to cache and restore
5959
path: ${{github.workspace}}/codeql_home
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// GENERATED FILE - DO NOT MODIFY
2+
import codingstandards.cpp.rules.functiontypesnotinprototypeformshared.FunctionTypesNotInPrototypeFormShared
3+
4+
class TestFileQuery extends FunctionTypesNotInPrototypeFormSharedSharedQuery, TestQuery { }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// GENERATED FILE - DO NOT MODIFY
2+
import codingstandards.cpp.rules.missingstaticspecifierobjectredeclarationshared.MissingStaticSpecifierObjectRedeclarationShared
3+
4+
class TestFileQuery extends MissingStaticSpecifierObjectRedeclarationSharedSharedQuery, TestQuery {
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* @id c/misra/call-to-obsolescent-function-gets
3+
* @name RULE-1-5: Disallowed usage of obsolescent function 'gets'
4+
* @description The function 'gets' is an obsolescent language feature which was removed in C11.
5+
* @kind problem
6+
* @precision very-high
7+
* @problem.severity error
8+
* @tags external/misra/id/rule-1-5
9+
* external/misra/c/2012/amendment3
10+
* security
11+
* maintainability
12+
* external/misra/obligation/required
13+
*/
14+
15+
import cpp
16+
import codingstandards.c.misra
17+
18+
from FunctionCall fc
19+
where
20+
not isExcluded(fc, Language4Package::callToObsolescentFunctionGetsQuery()) and
21+
fc.getTarget().hasGlobalOrStdName("gets")
22+
select fc, "Call to obsolescent function 'gets'."
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* @id c/misra/function-types-not-in-prototype-form-obsolete
3+
* @name RULE-1-5: Function types shall be in prototype form with named parameters
4+
* @description The use of non-prototype format parameter type declarators is an obsolescent
5+
* language feature.
6+
* @kind problem
7+
* @precision medium
8+
* @problem.severity error
9+
* @tags external/misra/id/rule-1-5
10+
* correctness
11+
* external/misra/c/2012/amendment3
12+
* external/misra/obligation/required
13+
*/
14+
15+
import cpp
16+
import codingstandards.c.misra
17+
import codingstandards.cpp.rules.functiontypesnotinprototypeformshared.FunctionTypesNotInPrototypeFormShared
18+
19+
class FunctionTypesNotInPrototypeFormObsoleteQuery extends FunctionTypesNotInPrototypeFormSharedSharedQuery
20+
{
21+
FunctionTypesNotInPrototypeFormObsoleteQuery() {
22+
this = Language4Package::functionTypesNotInPrototypeFormObsoleteQuery()
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**
2+
* @id c/misra/invalid-define-or-undef-of-std-bool-macro
3+
* @name RULE-1-5: Programs may not undefine or redefine the macros bool, true, or false
4+
* @description Directives that undefine and/or redefine the standard boolean macros has been
5+
* declared an obsolescent language feature since C99.
6+
* @kind problem
7+
* @precision very-high
8+
* @problem.severity warning
9+
* @tags external/misra/id/rule-1-5
10+
* maintainability
11+
* readability
12+
* external/misra/c/2012/amendment3
13+
* external/misra/obligation/required
14+
*/
15+
16+
import cpp
17+
import codingstandards.c.misra
18+
19+
string getABoolMacroName() { result = ["true", "false", "bool"] }
20+
21+
from PreprocessorDirective directive, string opString, string macroName
22+
where
23+
not isExcluded(directive, Language4Package::invalidDefineOrUndefOfStdBoolMacroQuery()) and
24+
macroName = getABoolMacroName() and
25+
(
26+
macroName = directive.(Macro).getName() and
27+
opString = "define"
28+
or
29+
macroName = directive.(PreprocessorUndef).getName() and
30+
opString = "undefine"
31+
)
32+
select directive, "Invalid " + opString + " of boolean standard macro '" + macroName + "'."

0 commit comments

Comments
 (0)