The assembly code remains unchanged.
In addition, this PR enables MSVC warning C4146 for the entire codebase.
I think rewriting -x
to (0 - x)
is a bit nicer than `(~x + 1).
With that change applied, I think I’m literally ~0 on that PR: On the one hand, changing the code to make the compiler happy is not great… But perhaps having a clean build with just /W2 is good.
The assembly code remains unchanged.
In addition, this change enables MSVC warning C4146 for the entire
codebase.
See: https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-2-c4146
I think rewriting
-x
to(0 - x)
is a bit nicer than `(~x + 1).
Done.
On the one hand, changing the code to make the compiler happy is not great…
I agree with you.
But perhaps having a clean build with just /W2 is good.
That is my point.
-x
to 0-x
seems a bit annoying. I can imagine that this will confuse potential future reviewers. I don’t think that’s worth it.
Concept NACK, I think the resulting code is harder to read.
The warning in my opinion is silly (at least for our codebase), so the proper action is the disable the warning, not work around it.