-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C++: Remove the BMN filter from some queries, but reduce precision to medium #20410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… medium Remove the `not any(Compilation c).buildModeNone() and` clause from: cpp/wrong-type-format-argument cpp/comparison-with-wider-type cpp/integer-multiplication-cast-to-long cpp/implicit-function-declaration cpp/suspicious-add-sizeof but reduce their precision to `medium`.
5dadbb7
to
b3f4c68
Compare
Queries affected: cpp/wrong-type-format-argument cpp/comparison-with-wider-type cpp/integer-multiplication-cast-to-long cpp/implicit-function-declaration cpp/suspicious-add-sizeof
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes the BMN (Build Mode None) filter from five C++ CodeQL queries while reducing their precision from "high" to "medium". The changes enable these queries to now run on projects built with build-mode: none
but at a lower confidence level.
- Removes
not any(Compilation c).buildModeNone() and
clause from 5 queries - Changes precision metadata from
@precision high
to@precision medium
- Updates query suites to exclude 4 of these queries from code-scanning
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
cpp/ql/src/change-notes/2025-09-11-queries-demoted.md | Documents the precision reduction and suite changes for affected queries |
cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql | Removes BMN filter and reduces precision to medium |
cpp/ql/src/Security/CWE/CWE-190/ComparisonWithWiderType.ql | Removes BMN filter and reduces precision to medium |
cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql | Removes BMN filter and reduces precision to medium |
cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.ql | Removes BMN filter and reduces precision to medium |
cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql | Removes BMN filter and reduces precision to medium |
cpp/ql/integration-tests/query-suite/cpp-code-scanning.qls.expected | Removes 4 queries from the code-scanning suite |
category: majorAnalysis | ||
--- | ||
* The queries `cpp/wrong-type-format-argument`, `cpp/comparison-with-wider-type`, `cpp/integer-multiplication-cast-to-long`, `cpp/implicit-function-declaration` and `cpp/suspicious-add-sizeof` have had their precisions reduced from `high` to `medium`. They will also now give alerts for projects built with `build-mode: none`. | ||
* The queries `cpp/wrong-type-format-argument`, `cpp/comparison-with-wider-type`, `cpp/integer-multiplication-cast-to-long` and `cpp/suspicious-add-sizeof` are no longer included in the `code-scanning` suite. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change note lists only 4 queries as being removed from the code-scanning
suite, but the description mentions 5 queries total. The cpp/implicit-function-declaration
query is missing from this list, though it appears this query was never in the code-scanning suite to begin with. Consider clarifying this discrepancy or adding a note that cpp/implicit-function-declaration
was not previously included in the suite.
* The queries `cpp/wrong-type-format-argument`, `cpp/comparison-with-wider-type`, `cpp/integer-multiplication-cast-to-long` and `cpp/suspicious-add-sizeof` are no longer included in the `code-scanning` suite. | |
* The queries `cpp/wrong-type-format-argument`, `cpp/comparison-with-wider-type`, `cpp/integer-multiplication-cast-to-long` and `cpp/suspicious-add-sizeof` are no longer included in the `code-scanning` suite. | |
* Note: `cpp/implicit-function-declaration` was not previously included in the `code-scanning` suite. |
Copilot uses AI. Check for mistakes.
Remove the
not any(Compilation c).buildModeNone() and
clause from:but reduce their precision to
medium
.