Skip to content

Commit 0917493

Browse files
authored
Merge branch 'main' into lcartey/a7-1-2
2 parents 648f583 + 7644032 commit 0917493

File tree

19 files changed

+35
-21
lines changed

19 files changed

+35
-21
lines changed

c/cert/src/qlpack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/cert-c-coding-standards
2-
version: 2.29.0-dev
2+
version: 2.30.0-dev
33
description: CERT C 2016
44
suites: codeql-suites
55
license: MIT

c/cert/test/qlpack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/cert-c-coding-standards-tests
2-
version: 2.29.0-dev
2+
version: 2.30.0-dev
33
extractor: cpp
44
license: MIT
55
dependencies:

c/common/src/qlpack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/common-c-coding-standards
2-
version: 2.29.0-dev
2+
version: 2.30.0-dev
33
license: MIT
44
dependencies:
55
codeql/common-cpp-coding-standards: '*'

c/common/test/qlpack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/common-c-coding-standards-tests
2-
version: 2.29.0-dev
2+
version: 2.30.0-dev
33
extractor: cpp
44
license: MIT
55
dependencies:

c/misra/src/qlpack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/misra-c-coding-standards
2-
version: 2.29.0-dev
2+
version: 2.30.0-dev
33
description: MISRA C 2012
44
suites: codeql-suites
55
license: MIT

c/misra/test/qlpack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/misra-c-coding-standards-tests
2-
version: 2.29.0-dev
2+
version: 2.30.0-dev
33
extractor: cpp
44
license: MIT
55
dependencies:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- `A18-5-8` - `UnnecessaryUseOfDynamicStorage.ql`:
2+
- Address FP reported in #20. Add model of flow from MakeSharedOrUnique to return expression to capture copy/move elision case NRVO.

cpp/autosar/src/qlpack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/autosar-cpp-coding-standards
2-
version: 2.29.0-dev
2+
version: 2.30.0-dev
33
description: AUTOSAR C++14 Guidelines R22-11, R21-11, R20-11, R19-11 and R19-03
44
suites: codeql-suites
55
license: MIT

cpp/autosar/src/rules/A18-5-8/UnnecessaryUseOfDynamicStorage.ql

+3
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ class MakeSharedOrUnique extends FunctionCall, CandidateFunctionLocalHeapAllocat
5353
// This includes the case where a result of `make_shared` or `make_unique` is return by a function
5454
// because the compiler will call the appropriate constructor.
5555
not exists(FunctionCall fc | DataFlow::localExprFlow(this, fc.getAnArgument())) and
56+
// The flow to a return statement is explicitly modelled for the case where
57+
// the copy/move constructor is elided and therefore there is no actual function call in the database
58+
not exists(ReturnStmt ret | DataFlow::localExprFlow(this, ret.getExpr())) and
5659
// Not assigned to a field
5760
not exists(Field f | DataFlow::localExprFlow(this, f.getAnAssignedValue()))
5861
}

cpp/autosar/test/qlpack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/autosar-cpp-coding-standards-tests
2-
version: 2.29.0-dev
2+
version: 2.30.0-dev
33
extractor: cpp
44
license: MIT
55
dependencies:

cpp/autosar/test/rules/A18-5-8/test.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,13 @@ StructA *test_failure() {
6868
a = nullptr;
6969
}
7070
return a;
71+
}
72+
73+
#include <string>
74+
std::unique_ptr<StructA>
75+
test_for_fp_reported_in_20(const std::string &s) noexcept {
76+
// make_unique performs heap allocation
77+
// but this outlives the function due to copy elision
78+
// (specifically NRVO)
79+
return std::make_unique<StructA>(s); // COMPLIANT
7180
}

cpp/cert/src/qlpack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/cert-cpp-coding-standards
2-
version: 2.29.0-dev
2+
version: 2.30.0-dev
33
description: CERT C++ 2016
44
suites: codeql-suites
55
license: MIT

cpp/cert/test/qlpack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/cert-cpp-coding-standards-tests
2-
version: 2.29.0-dev
2+
version: 2.30.0-dev
33
extractor: cpp
44
license: MIT
55
dependencies:

cpp/common/src/qlpack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/common-cpp-coding-standards
2-
version: 2.29.0-dev
2+
version: 2.30.0-dev
33
license: MIT
44
dependencies:
55
codeql/cpp-all: 0.9.3

cpp/common/test/qlpack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/common-cpp-coding-standards-tests
2-
version: 2.29.0-dev
2+
version: 2.30.0-dev
33
extractor: cpp
44
license: MIT
55
dependencies:

cpp/misra/src/qlpack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/misra-cpp-coding-standards
2-
version: 2.29.0-dev
2+
version: 2.30.0-dev
33
description: MISRA C++ 2008
44
suites: codeql-suites
55
license: MIT

cpp/misra/test/qlpack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/misra-cpp-coding-standards-tests
2-
version: 2.29.0-dev
2+
version: 2.30.0-dev
33
extractor: cpp
44
license: MIT
55
dependencies:

cpp/report/src/qlpack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/report-cpp-coding-standards
2-
version: 2.29.0-dev
2+
version: 2.30.0-dev
33
license: MIT
44
dependencies:
55
codeql/cpp-all: 0.9.3

docs/user_manual.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@
2929

3030
## Release information
3131

32-
This user manual documents release `2.29.0-dev` of the coding standards located at [https://github.com/github/codeql-coding-standards](https://github.com/github/codeql-coding-standards).
32+
This user manual documents release `2.30.0-dev` of the coding standards located at [https://github.com/github/codeql-coding-standards](https://github.com/github/codeql-coding-standards).
3333
The release page documents the release notes and contains the following artifacts part of the release:
3434

35-
- `code-scanning-cpp-query-pack-2.29.0-dev.zip`: coding standard queries and scripts to be used with GitHub Code Scanning or the CodeQL CLI as documented in the section _Operating manual_.
36-
- `supported_rules_list_2.29.0-dev.csv`: A Comma Separated File (CSV) containing the supported rules per standard and the queries that implement the rule.
37-
- `supported_rules_list_2.29.0-dev.md`: A Markdown formatted file with a table containing the supported rules per standard and the queries that implement the rule.
38-
- `user_manual_2.29.0-dev.md`: This user manual.
35+
- `code-scanning-cpp-query-pack-2.30.0-dev.zip`: coding standard queries and scripts to be used with GitHub Code Scanning or the CodeQL CLI as documented in the section _Operating manual_.
36+
- `supported_rules_list_2.30.0-dev.csv`: A Comma Separated File (CSV) containing the supported rules per standard and the queries that implement the rule.
37+
- `supported_rules_list_2.30.0-dev.md`: A Markdown formatted file with a table containing the supported rules per standard and the queries that implement the rule.
38+
- `user_manual_2.30.0-dev.md`: This user manual.
3939
- `Source Code (zip)`: A zip archive containing the contents of https://github.com/github/codeql-coding-standards
4040
- `Source Code (tar.gz)`: A GZip compressed tar archive containing the contents of https://github.com/github/codeql-coding-standards
4141
- `checksums.txt`: A text file containing sha256 checksums for the aforementioned artifacts.
@@ -496,7 +496,7 @@ This section describes known failure modes for "CodeQL Coding Standards" and des
496496
| | Ouf of space | Less output. Some files may be only be partially analyzed, or not analyzed at all. | Error reported on the command line. | Increase space. If it remains an issue report space consumption issues via the CodeQL Coding Standards [bug tracker](https://github.com/github/codeql-coding-standards/issues). |
497497
| | False positives | More output. Results are reported which are not violations of the guidelines. | All reported results must be reviewed. | Report false positive issues via the CodeQL Coding Standards [bug tracker](https://github.com/github/codeql-coding-standards/issues). |
498498
| | False negatives | Less output. Violations of the guidelines are not reported. | Other validation and verification processes during software development should be used to complement the analysis performed by CodeQL Coding Standards. | Report false negative issues via the CodeQL Coding Standards [bug tracker](https://github.com/github/codeql-coding-standards/issues). |
499-
| | Modifying coding standard suite | More or less output. If queries are added to the query set more result can be reported. If queries are removed less results might be reported. | All queries supported by the CodeQL Coding Standards are listed in the release artifacts `supported_rules_list_2.29.0-dev.csv` where VERSION is replaced with the used release. The rules in the resulting Sarif file must be cross-referenced with the expected rules in this list to determine the validity of the used CodeQL suite. | Ensure that the CodeQL Coding Standards are not modified in ways that are not documented as supported modifications. |
499+
| | Modifying coding standard suite | More or less output. If queries are added to the query set more result can be reported. If queries are removed less results might be reported. | All queries supported by the CodeQL Coding Standards are listed in the release artifacts `supported_rules_list_2.30.0-dev.csv` where VERSION is replaced with the used release. The rules in the resulting Sarif file must be cross-referenced with the expected rules in this list to determine the validity of the used CodeQL suite. | Ensure that the CodeQL Coding Standards are not modified in ways that are not documented as supported modifications. |
500500
| | Incorrect deviation record specification | More output. Results are reported for guidelines for which a deviation is assigned. | Analysis integrity report lists all deviations and incorrectly specified deviation records with a reason. Ensure that all deviation records are correctly specified. | Ensure that the deviation record is specified according to the specification in the user manual. |
501501
| | Incorrect deviation permit specification | More output. Results are reported for guidelines for which a deviation is assigned. | Analysis integrity report lists all deviations and incorrectly specified deviation permits with a reason. Ensure that all deviation permits are correctly specified. | Ensure that the deviation record is specified according to the specification in the user manual. |
502502
| | Unapproved use of a deviation record | Less output. Results for guideline violations are not reported. | Validate that the deviation record use is approved by verifying the approved-by attribute of the deviation record specification. | Ensure that each raised deviation record is approved by an independent approver through an auditable process. |

0 commit comments

Comments
 (0)