Skip to content

Commit ed7bd0f

Browse files
committed
Merge branch 'mbaluda-new-dataflow' into mbaluda-next
2 parents 0b206ff + a0d501e commit ed7bd0f

393 files changed

Lines changed: 12562 additions & 951 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/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: |

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ This repository contains CodeQL queries and libraries which support various Codi
66

77
_Carnegie Mellon and CERT are registered trademarks of Carnegie Mellon University._
88

9-
This repository contains CodeQL queries and libraries which support various Coding Standards for the [C++14](https://www.iso.org/standard/64029.html), [C99](https://www.iso.org/standard/29237.html) and [C11](https://www.iso.org/standard/57853.html) programming languages.
9+
This repository contains CodeQL queries and libraries which support various Coding Standards for the [C++14](https://www.iso.org/standard/64029.html), [C++17](https://www.iso.org/standard/68564.html), [C99](https://www.iso.org/standard/29237.html) and [C11](https://www.iso.org/standard/57853.html) programming languages.
1010

1111
The following coding standards are supported:
1212
- [AUTOSAR - Guidelines for the use of C++14 language in critical and safety-related systems (Releases R22-11, R20-11, R19-11 and R19-03)](https://www.autosar.org/fileadmin/standards/R22-11/AP/AUTOSAR_RS_CPP14Guidelines.pdf).
1313
- [SEI CERT C++ Coding Standard: Rules for Developing Safe, Reliable, and Secure Systems (2016 Edition)](https://resources.sei.cmu.edu/library/asset-view.cfm?assetID=494932)
1414
- [SEI CERT C Coding Standard: Rules for Developing Safe, Reliable, and Secure Systems (2016 Edition)](https://resources.sei.cmu.edu/downloads/secure-coding/assets/sei-cert-c-coding-standard-2016-v01.pdf)
15+
- [MISRA C++ 2023: Guidelines for the use of C++ in critical systems](https://misra.org.uk/product/misra-cpp2023/).
1516
- [MISRA C 2012, 3rd Edition, 1st revision](https://www.misra.org.uk/product/misra-c2012-third-edition-first-revision/) (incoporating Amendment 1 & Technical Corrigendum 1). In addition, we support the following additional amendments and technical corrigendums:
1617
- [MISRA C 2012 Amendment 2](https://misra.org.uk/app/uploads/2021/06/MISRA-C-2012-AMD2.pdf)
1718
- [MISRA C 2012 Technical Corrigendum 2](https://misra.org.uk/app/uploads/2022/04/MISRA-C-2012-TC2.pdf)
@@ -21,9 +22,13 @@ The following coding standards are supported:
2122

2223
## :construction: Standards under development :construction:
2324

24-
The following standards are under active development for [C++17](https://www.iso.org/standard/68564.html):
25+
There are currently no new coding standards under active development.
2526

26-
- [MISRA C++ 2023](https://misra.org.uk/product/misra-cpp2023/) - under development - _scheduled for release 2026 Q1/Q2_
27+
This project intends to begin development of the following standards in the near future:
28+
29+
- [MISRA C 2025](https://misra.org.uk/product/misra-c2025/)
30+
31+
If you are interested in this standard or when it will be available, consider contacting us via email or by filing an issue.
2732

2833
## How do I use the CodeQL Coding Standards Queries?
2934

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.57.0-dev
2+
version: 2.62.0-dev
33
description: CERT C 2016
44
suites: codeql-suites
55
license: MIT

c/cert/src/rules/DCL40-C/ExternalIdentifiers.qll

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

c/cert/src/rules/DCL40-C/IncompatibleFunctionDeclarations.ql

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -21,42 +21,11 @@
2121

2222
import cpp
2323
import codingstandards.c.cert
24-
import codingstandards.cpp.types.Compatible
25-
import ExternalIdentifiers
24+
import codingstandards.cpp.rules.incompatiblefunctiondeclaration.IncompatibleFunctionDeclaration
2625

27-
predicate interestedInFunctions(
28-
FunctionDeclarationEntry f1, FunctionDeclarationEntry f2, ExternalIdentifiers d
29-
) {
30-
not f1 = f2 and
31-
d = f1.getDeclaration() and
32-
d = f2.getDeclaration()
26+
module IncompatibleFunctionDeclarationsCppConfig implements IncompatibleFunctionDeclarationConfigSig
27+
{
28+
Query getQuery() { result = Declarations2Package::incompatibleFunctionDeclarationsQuery() }
3329
}
3430

35-
predicate interestedInFunctions(FunctionDeclarationEntry f1, FunctionDeclarationEntry f2) {
36-
interestedInFunctions(f1, f2, _)
37-
}
38-
39-
module FuncDeclEquiv =
40-
FunctionDeclarationTypeEquivalence<TypesCompatibleConfig, interestedInFunctions/2>;
41-
42-
from ExternalIdentifiers d, FunctionDeclarationEntry f1, FunctionDeclarationEntry f2
43-
where
44-
not isExcluded(f1, Declarations2Package::incompatibleFunctionDeclarationsQuery()) and
45-
not isExcluded(f2, Declarations2Package::incompatibleFunctionDeclarationsQuery()) and
46-
interestedInFunctions(f1, f2, d) and
47-
(
48-
//return type check
49-
not FuncDeclEquiv::equalReturnTypes(f1, f2)
50-
or
51-
//parameter type check
52-
not FuncDeclEquiv::equalParameterTypes(f1, f2)
53-
) and
54-
// Apply ordering on start line, trying to avoid the optimiser applying this join too early
55-
// in the pipeline
56-
exists(int f1Line, int f2Line |
57-
f1.getLocation().hasLocationInfo(_, f1Line, _, _, _) and
58-
f2.getLocation().hasLocationInfo(_, f2Line, _, _, _) and
59-
f1Line >= f2Line
60-
)
61-
select f1, "The object $@ is not compatible with re-declaration $@", f1, f1.getName(), f2,
62-
f2.getName()
31+
import IncompatibleFunctionDeclaration<IncompatibleFunctionDeclarationsCppConfig>

c/cert/src/rules/DCL40-C/IncompatibleObjectDeclarations.ql

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,10 @@
2020

2121
import cpp
2222
import codingstandards.c.cert
23-
import ExternalIdentifiers
23+
import codingstandards.cpp.rules.incompatibleobjectdeclaration.IncompatibleObjectDeclaration
2424

25-
from VariableDeclarationEntry decl1, VariableDeclarationEntry decl2
26-
where
27-
not isExcluded(decl1, Declarations2Package::incompatibleObjectDeclarationsQuery()) and
28-
not isExcluded(decl2, Declarations2Package::incompatibleObjectDeclarationsQuery()) and
29-
not decl1.getUnspecifiedType() = decl2.getUnspecifiedType() and
30-
decl1.getDeclaration() instanceof ExternalIdentifiers and
31-
decl2.getDeclaration() instanceof ExternalIdentifiers and
32-
decl1.getLocation().getStartLine() >= decl2.getLocation().getStartLine() and
33-
decl1.getVariable().getName() = decl2.getVariable().getName()
34-
select decl1, "The object $@ is not compatible with re-declaration $@", decl1, decl1.getName(),
35-
decl2, decl2.getName()
25+
module IncompatibleObjectDeclarationsCppConfig implements IncompatibleObjectDeclarationConfigSig {
26+
Query getQuery() { result = Declarations2Package::incompatibleObjectDeclarationsQuery() }
27+
}
28+
29+
import IncompatibleObjectDeclaration<IncompatibleObjectDeclarationsCppConfig>

c/cert/src/rules/EXP30-C/DependenceOnOrderOfFunctionArgumentsForSideEffects.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import cpp
2020
import codingstandards.c.cert
2121
import codingstandards.cpp.SideEffect
22-
import semmle.code.cpp.dataflow.TaintTracking
22+
import semmle.code.cpp.dataflow.new.TaintTracking
2323
import semmle.code.cpp.valuenumbering.GlobalValueNumbering
2424

2525
/** Holds if the function's return value is derived from the `AliasParamter` p. */

0 commit comments

Comments
 (0)