Skip to content

Commit f9a503b

Browse files
authored
Merge branch 'main' into knewbury01/fix-381
2 parents 644d0ff + eb04437 commit f9a503b

35 files changed

+145
-108
lines changed

.github/workflows/bump-version.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/finalize-release.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,21 @@ jobs:
9999
next_version=$(python scripts/release/next-version.py --component minor --pre-release dev -- $version)
100100
echo "NEXT_VERSION=$next_version" >> "$GITHUB_ENV"
101101
working-directory: tooling
102+
103+
- name: Generate token
104+
if: env.HOTFIX_RELEASE == 'false'
105+
id: generate-token
106+
uses: actions/create-github-app-token@eaddb9eb7e4226c68cf4b39f167c83e5bd132b3e
107+
with:
108+
app-id: ${{ vars.AUTOMATION_APP_ID }}
109+
private-key: ${{ secrets.AUTOMATION_PRIVATE_KEY }}
110+
owner: ${{ github.repository_owner }}
111+
repositories: "codeql-coding-standards"
102112

103113
- name: Bump main version
114+
if: env.HOTFIX_RELEASE == 'false'
104115
env:
105-
GH_TOKEN: ${{ github.token }}
116+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
106117
run: |
107118
echo "Bumping main version to $NEXT_VERSION"
108119

c/cert/src/qlpack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/cert-c-coding-standards
2-
version: 2.25.0-dev
2+
version: 2.28.0-dev
33
description: CERT C 2016
44
suites: codeql-suites
55
license: MIT

c/cert/test/qlpack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/cert-c-coding-standards-tests
2-
version: 2.25.0-dev
2+
version: 2.28.0-dev
33
extractor: cpp
44
license: MIT
55
dependencies:

c/common/src/qlpack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/common-c-coding-standards
2-
version: 2.25.0-dev
2+
version: 2.28.0-dev
33
license: MIT
44
dependencies:
55
codeql/common-cpp-coding-standards: '*'

c/common/test/qlpack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/common-c-coding-standards-tests
2-
version: 2.25.0-dev
2+
version: 2.28.0-dev
33
extractor: cpp
44
license: MIT
55
dependencies:

c/misra/src/qlpack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/misra-c-coding-standards
2-
version: 2.25.0-dev
2+
version: 2.28.0-dev
33
description: MISRA C 2012
44
suites: codeql-suites
55
license: MIT

c/misra/src/rules/RULE-6-1/BitFieldsShallOnlyBeDeclaredWithAnAppropriateType.ql

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,33 @@
1212

1313
import cpp
1414
import codingstandards.c.misra
15+
import codingstandards.cpp.Compiler
1516

16-
predicate isAppropriatePrimitive(Type type) {
17-
/* An appropriate primitive types to which a bit-field can be declared. */
18-
type instanceof IntType and
17+
Type getSupportedBitFieldType(Compiler compiler) {
18+
compiler instanceof UnsupportedCompiler and
1919
(
20-
type.(IntegralType).isExplicitlySigned() or
21-
type.(IntegralType).isExplicitlyUnsigned()
20+
result instanceof IntType and
21+
(
22+
result.(IntegralType).isExplicitlySigned() or
23+
result.(IntegralType).isExplicitlyUnsigned()
24+
)
25+
or
26+
result instanceof BoolType
2227
)
2328
or
24-
type instanceof BoolType
29+
(compiler instanceof Gcc or compiler instanceof Clang) and
30+
(
31+
result instanceof IntegralOrEnumType
32+
or
33+
result instanceof BoolType
34+
)
2535
}
2636

2737
from BitField bitField
2838
where
2939
not isExcluded(bitField,
3040
BitfieldTypesPackage::bitFieldsShallOnlyBeDeclaredWithAnAppropriateTypeQuery()) and
3141
/* A violation would neither be an appropriate primitive type nor an appropriate typedef. */
32-
not isAppropriatePrimitive(bitField.getType().resolveTypedefs())
33-
select bitField, "Bit-field " + bitField + " is declared on type " + bitField.getType() + "."
42+
not getSupportedBitFieldType(getCompiler(bitField.getFile())) =
43+
bitField.getType().resolveTypedefs()
44+
select bitField, "Bit-field '" + bitField + "' is declared on type '" + bitField.getType() + "'."

c/misra/test/qlpack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/misra-c-coding-standards-tests
2-
version: 2.25.0-dev
2+
version: 2.28.0-dev
33
extractor: cpp
44
license: MIT
55
dependencies:
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
| test.c:6:7:6:8 | x1 | Bit-field x1 is declared on type int. |
2-
| test.c:10:15:10:16 | x5 | Bit-field x5 is declared on type signed long. |
3-
| test.c:12:15:12:16 | x6 | Bit-field x6 is declared on type signed char. |
4-
| test.c:14:14:14:15 | x7 | Bit-field x7 is declared on type Color. |
1+
| test.c:6:7:6:8 | x1 | Bit-field 'x1' is declared on type 'int'. |
2+
| test.c:10:15:10:16 | x5 | Bit-field 'x5' is declared on type 'signed long'. |
3+
| test.c:12:15:12:16 | x6 | Bit-field 'x6' is declared on type 'signed char'. |
4+
| test.c:14:14:14:15 | x7 | Bit-field 'x7' is declared on type 'Color'. |

0 commit comments

Comments
 (0)