Skip to content

<vector>: Silence static analysis warning C26450 - #5707

Merged
Stephan T. Lavavej (StephanTLavavej) merged 1 commit into
microsoft:mainfrom
StephanTLavavej:static-electricity
Sep 3, 2025
Merged

<vector>: Silence static analysis warning C26450#5707
Stephan T. Lavavej (StephanTLavavej) merged 1 commit into
microsoft:mainfrom
StephanTLavavej:static-electricity

Conversation

@StephanTLavavej

Copy link
Copy Markdown
Member

In certain cases (not found by our test coverage, but by the MSVC codebase's own usage), /analyze emits a false positive warning about integer overflow, when we've carefully guarded against integer overflow. Carson Radtke (@carsonRadtke) has filed VSO-2565428 "C26450 FP in STL/vector" to track fixing this in /analyze. Until then, we should push-disable-pop the warning around the affected code.

Followup to #5550 and #5566. So it's time for a quote:

"I remember that we cleared this world out. We won. Is a future coming in which we will, eventually, truly, have won?"

- Ra (Abstract Weapon) by qntm

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks for taking care of the warning.

@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit 8722a5e into microsoft:main Sep 3, 2025
39 checks passed
@github-project-automation github-project-automation Bot moved this from Final Review to Done in STL Code Reviews Sep 3, 2025
@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) deleted the static-electricity branch September 3, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Something can be improved

2 participants