You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use cmake build zfp and general example "arraycpp", but when i run it in visual stdio 2022, there's a error: C4146 Unary minus operator applied to unsigned type, the result is still unsigned. It is in store.hpp in 241 rows.I don't know how to fix it.
The text was updated successfully, but these errors were encountered:
Nothing to be fixed here--the code is correct and unary negation is perfectly defined for unsigned types. Surely VS is just being overly cautious and giving a warning, not an error, right? And don't be fooled by Microsoft's documentation that suggests "An unsigned value is unchanged by the unary negation operator." That is blatantly false. For example, -(1u) == 0xff...fu.
We might look into suppressing this warning, but it should have no bearing on the correctness of the code.
I use cmake build zfp and general example "arraycpp", but when i run it in visual stdio 2022, there's a error: C4146 Unary minus operator applied to unsigned type, the result is still unsigned. It is in store.hpp in 241 rows.I don't know how to fix it.
The text was updated successfully, but these errors were encountered: