Skip to content

Conversation

StephanTLavavej
Copy link
Member

This is cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification, "Year field changed using an arithmetic operation without checking for leap year".

Only the line with the conditional operator appeared to be emitting this warning, but to be safe I'm restructuring the code to use if-statements consistently (the comments make it clearer anyways), and to suppress the CodeQL warning whenever we're performing arithmetic.

Should prevent a blizzard of internal bugs like OS-57986329 from being created in the future.

This is cpp/microsoft/public/leap-year/unchecked-after-arithmetic-year-modification,
"Year field changed using an arithmetic operation without checking for leap year".

Only the line with the conditional operator appeared to be emitting this warning,
but to be safe I'm restructuring the code to use if-statements consistently
(the comments make it clearer anyways), and to suppress the CodeQL warning whenever we're performing arithmetic.
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner June 24, 2025 23:19
@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Jun 24, 2025
@github-project-automation github-project-automation bot moved this to Initial Review in STL Code Reviews Jun 24, 2025
@StephanTLavavej StephanTLavavej moved this from Initial Review to Final Review in STL Code Reviews Jun 24, 2025
@StephanTLavavej StephanTLavavej moved this from Final Review to Ready To Merge in STL Code Reviews Jul 11, 2025
@StephanTLavavej StephanTLavavej moved this from Ready To Merge to Merging in STL Code Reviews Jul 14, 2025
@StephanTLavavej
Copy link
Member Author

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit a728288 into microsoft:main Jul 15, 2025
39 checks passed
@github-project-automation github-project-automation bot moved this from Merging to Done in STL Code Reviews Jul 15, 2025
@StephanTLavavej StephanTLavavej deleted the power-word-silence branch July 15, 2025 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something can be improved
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants