-
Notifications
You must be signed in to change notification settings - Fork 104
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
Integral constant overflow in MSVC #68
Comments
It looks like changing the definition of
|
I'd say overflow on a plus on unsigned type is not an issue because it's perfectly defined (unlike the signed version). What could be done instead of your cast is to apply a mask, as in |
No, those don't help; but I wouldn't really expect them to, since the warning is raised for the |
@serge-sans-paille clang-cl doesn't warn on this. Maybe just suppress the warning? |
Sadly the warning is raised at point of I did file a bug with MS about the warning behaviour, so we can just sit on it and see if anything comes of that. |
On Thu, Feb 21, 2019 at 10:28:46PM -0800, degski wrote:
@serge-sans-paille clang-cl doesn't warn on this. Maybe just suppress the
warning?
You mean, using a pragma, or using a compiler flag? Can we disable warning
locally?
|
@serge-sans-paille Yes, something like this, there are various options, more or less portable. |
@degski So, how many different ways do you want me to tell you that pragma suppressions don't work? Because this is the third time I've said that. |
On MSVC 15.8.5, this reports
Which then causes compilation to fail if using warnings as errors. This also occurs with
unordered_map
, but not withset
ormap
. Oddly the warning goes away ifconstexpr
is removed.Is this warning benign or worrisome? Can it be fixed inside
frozen
somewhere? (Unfortunately it doesn't indicate which particular use of+
causes the overflow -- it just reports on that line above, not on something insidefrozen
.)The text was updated successfully, but these errors were encountered: