Fix static analysis warning C4146 in caltest.cpp - #193
Open
Hanumant Shinde (therealhshinde) wants to merge 2 commits into
Open
Fix static analysis warning C4146 in caltest.cpp#193Hanumant Shinde (therealhshinde) wants to merge 2 commits into
Hanumant Shinde (therealhshinde) wants to merge 2 commits into
Conversation
added 2 commits
August 13, 2026 15:01
Use INT32_MIN for the two signed 32-bit minimum test inputs so MSVC does not parse the magnitude as unsigned before applying unary minus. Bug: microsoft/OS#164343 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66c0022c-72ad-4331-9459-b0c73c068072
Preserve the MSVC warning fix across future upstream ICU source imports. Bug: microsoft/OS#164343 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66c0022c-72ad-4331-9459-b0c73c068072
Collaborator
Author
|
@microsoft-github-policy-service agree company="Microsoft" |
Hanumant Shinde (therealhshinde)
requested review from
aoruganti-msft and
Rahul Pandey (rp9-next)
August 13, 2026 11:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
Replace two
-2147483648test inputs incaltest.cppwithINT32_MIN. MSVC parses the decimal magnitude as unsigned before applying unary minus, producing C4146;INT32_MINexpresses the intended signed boundary directly without changing test behavior.The change also records the fix as permanent Microsoft patch
030-MSFT-Patch-Fix_MSVC_C4146_caltest.patchso it survives future upstream ICU source imports.Internal tracking: AB#164343
Compiler verification
Before
After
Test verification
intltestRelease x64 with Visual Studio 2022/MSVC.format/CalendarTestsuite: all tests passed.