Skip to content

Conversation

igfoo
Copy link
Contributor

@igfoo igfoo commented Sep 11, 2025

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.

@github-actions github-actions bot added the C++ label Sep 11, 2025
… 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`.
@igfoo igfoo added the depends on internal PR This PR should only be merged in sync with an internal Semmle PR label Sep 11, 2025
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
@igfoo igfoo marked this pull request as ready for review September 11, 2025 15:25
@Copilot Copilot AI review requested due to automatic review settings September 11, 2025 15:25
@igfoo igfoo requested a review from a team as a code owner September 11, 2025 15:25
Copy link
Contributor

@Copilot Copilot AI left a 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.
Copy link
Preview

Copilot AI Sep 11, 2025

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.

Suggested change
* 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.

@igfoo igfoo merged commit ffeece1 into github:main Sep 11, 2025
16 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ depends on internal PR This PR should only be merged in sync with an internal Semmle PR documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants