-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix C4365: '=': signed/unsigned mismatch
with /J
#3295
Conversation
I think this is a bug in the compiler; similar code without all of the stuff around it does not fire this warning. I would prefer we fix the compiler rather than work around it in the library, (or at least mark it with a transition). |
Okay, now that I look at it, it is an off-by-default warning; I personally think it's very silly to warn for: unsigned char c = ...;
c = c + 1; and I'd prefer we just turned off that warning or something along those lines. |
We already have the same static_cast for fixing the warning: Line 830 in 77ec5c6
_First is char* and __digits is uint32_t , this is why it is triggered without /J
|
I disagree with that - The |
We talked about this at the weekly maintainer meeting; warning C4365 is indeed one of the few off-by-default warnings we attempt to be clean for: STL/tests/std/tests/prefix.lst Line 6 in 8ddf4da
We additionally (grudgingly) support /J , in the running for the worst compiler option ever, so this is technically a bug.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I severely dislike both this warning and this option, but it is a correct change. Thanks!
Thanks for the fix and updated test coverage! This is a minimally invasive change for the Ryu-derived code. |
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
I had to push an additional commit to fix the internal test harness, as |
Thanks for fixing this warning! 🛠️ |
Fixes #3294