Skip to content

Commit 634f4b3

Browse files
authored
Merge branch 'main' into michaelrfairhust/toolchain2-be-iso-cpp17-compliant
2 parents 9a4bb8b + d6a6d46 commit 634f4b3

File tree

39 files changed

+813
-62
lines changed

39 files changed

+813
-62
lines changed

.github/workflows/codeql_unit_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ jobs:
168168
steps:
169169
- name: Check if run-test-suites job failed to complete, if so fail
170170
if: ${{ needs.run-test-suites.result == 'failure' }}
171-
uses: actions/github-script@v8
171+
uses: actions/github-script@v9
172172
with:
173173
script: |
174174
core.setFailed('Test run job failed')

.github/workflows/dispatch-matrix-test-on-comment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
--json \
4545
-R github/codeql-coding-standards-release-engineering
4646
47-
- uses: actions/github-script@v8
47+
- uses: actions/github-script@v9
4848
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/test-matrix') && steps.check-write-permission.outputs.has-permission }}
4949
with:
5050
script: |

.github/workflows/dispatch-release-performance-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
--json \
4545
-R github/codeql-coding-standards-release-engineering
4646
47-
- uses: actions/github-script@v8
47+
- uses: actions/github-script@v9
4848
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/test-performance') && steps.check-write-permission.outputs.has-permission }}
4949
with:
5050
script: |

.github/workflows/upgrade_codeql_dependencies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
find c \( -name '*.ql' -or -name '*.qll' \) -print0 | xargs -0 --max-procs "$XARGS_MAX_PROCS" codeql query format --in-place
5757
5858
- name: Create Pull Request
59-
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
59+
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
6060
with:
6161
title: "Upgrade `github/codeql` dependency to ${{ github.event.inputs.codeql_cli_version }}"
6262
body: |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- `A9-6-2` - `BitFieldsShallBeUsedOnlyWhenInterfacingToHardwareOrConformingToCommunicationProtocols.ql`:
2+
- Shorten the name to `BitFieldsShouldNotBeDeclaredAutosarCpp`, where the name shared query it imports is `BitFieldsShouldNotBeDeclared`.
3+
- Tag `"portability"` is added.
4+
- Alert message now includes single quotes around union name.

cpp/autosar/src/rules/A9-5-1/UnionsUsed.ql

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @id cpp/autosar/unions-used
33
* @name A9-5-1: Unions shall not be used
4-
* @description Unions shall not be used. Tagged untions can be used if std::variant is not
4+
* @description Unions shall not be used. Tagged unions can be used if 'std::variant' is not
55
* available.
66
* @kind problem
77
* @precision very-high
@@ -34,8 +34,9 @@ class TaggedUnion extends UserType {
3434
}
3535
}
3636

37-
from Union u
37+
from Union u, string message
3838
where
3939
not isExcluded(u, BannedSyntaxPackage::unionsUsedQuery()) and
40-
not u.getParentScope() instanceof TaggedUnion
41-
select u, u.getName() + " is not a tagged union."
40+
not u.getParentScope() instanceof TaggedUnion and
41+
message = "'" + u.getName() + "' is not a tagged union."
42+
select u, message

cpp/autosar/src/rules/A9-6-2/BitFieldsShallBeUsedOnlyWhenInterfacingToHardwareOrConformingToCommunicationProtocols.ql

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* @id cpp/autosar/bit-fields-should-not-be-declared-autosar-cpp
3+
* @name A9-6-2: Bit-fields shall be used only when interfacing to hardware or conforming to communication protocols
4+
* @description The usage of bit-fields increases code complexity and certain aspects of bit-field
5+
* manipulation can be error prone and implementation defined. Hence a bit-field usage
6+
* is reserved only when interfacing to hardware or conformance to communication
7+
* protocols.
8+
* @kind problem
9+
* @precision very-high
10+
* @problem.severity recommendation
11+
* @tags external/autosar/id/a9-6-2
12+
* maintainability
13+
* portability
14+
* external/autosar/allocated-target/design
15+
* external/autosar/enforcement/partially-automated
16+
* external/autosar/obligation/required
17+
*/
18+
19+
import cpp
20+
import codingstandards.cpp.autosar
21+
import codingstandards.cpp.rules.bitfieldsshouldnotbedeclared.BitFieldsShouldNotBeDeclared
22+
23+
module BitFieldsShouldNotBeDeclaredAutosarCppConfig implements BitFieldsShouldNotBeDeclaredConfigSig
24+
{
25+
Query getQuery() { result = RepresentationPackage::bitFieldsShouldNotBeDeclaredAutosarCppQuery() }
26+
}
27+
28+
import BitFieldsShouldNotBeDeclared<BitFieldsShouldNotBeDeclaredAutosarCppConfig>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| test.cpp:14:9:14:9 | u | u is not a tagged union. |
2-
| test.cpp:21:7:21:7 | u | u is not a tagged union. |
1+
| test.cpp:14:9:14:9 | u | 'u' is not a tagged union. |
2+
| test.cpp:21:7:21:7 | u | 'u' is not a tagged union. |

cpp/autosar/test/rules/A9-6-2/BitFieldsShallBeUsedOnlyWhenInterfacingToHardwareOrConformingToCommunicationProtocols.expected

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)