Skip to content

C++: Fix a crazy FP in cpp/leap-year/unsafe-array-for-days-of-the-year - #22460

Merged
MathiasVP merged 4 commits into
github:mainfrom
MathiasVP:add-crazy-fp
Aug 28, 2026
Merged

C++: Fix a crazy FP in cpp/leap-year/unsafe-array-for-days-of-the-year#22460
MathiasVP merged 4 commits into
github:mainfrom
MathiasVP:add-crazy-fp

Conversation

@MathiasVP

Copy link
Copy Markdown
Contributor

This is from an internal FP report at Microsoft. It is without a single level of doubt my favorite false positive in CodeQL ever. And I'm kinda excited that I get to share it with you all since it happened in a GitHub query 😂

Copilot AI balanced review requested due to automatic review settings August 28, 2026 12:43
@MathiasVP
MathiasVP requested a review from a team as a code owner August 28, 2026 12:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

Review tier: Balanced
Findings: 1 Low severity

New issues introduced by this change (1)
Severity Finding
Low severity cpp/​ql/​test/​query-tests/​Likely Bugs/​Leap Year/​UnsafeArrayForDaysOfYear/​test.cpp — This sentence is grammatically incomplete (which has no verb), and the following clause…
What changed in this PR

Prevents false positives caused by compiler-generated 365-character arrays such as __PRETTY_FUNCTION__.

Changes:

  • Excludes compiler-generated variables from the query.
  • Adds a focused regression case.
File Description
cpp/​ql/​src/​Likely Bugs/​Leap Year/​UnsafeArrayForDaysOfYear.ql Filters compiler-generated variables.
cpp/​ql/​test/​query-tests/​Likely Bugs/​Leap Year/​UnsafeArrayForDaysOfYear/​test.cpp Tests the __PRETTY_FUNCTION__ false positive.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cpp/ql/test/query-tests/Likely Bugs/Leap Year/UnsafeArrayForDaysOfYear/test.cpp Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
jketema
jketema previously approved these changes Aug 28, 2026

@jketema jketema left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@MathiasVP

Copy link
Copy Markdown
Contributor Author

Integration failures are unrelated. Merging!

@MathiasVP
MathiasVP merged commit 45c7a51 into github:main Aug 28, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants