Fix C4365: '=': signed/unsigned mismatch with /J#3295
Fix C4365: '=': signed/unsigned mismatch with /J#3295StephanTLavavej merged 2 commits intomicrosoft:mainfrom
C4365: '=': signed/unsigned mismatch with /J#3295Conversation
|
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.
|
strega-nil-ms
left a comment
There was a problem hiding this comment.
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