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
Generally, implicit casts from literal values that don't fit into the range of a target type will produce a warning and tell you the different value that will actually be used (based on truncation, etc...).
Here's an example:
// warning: implicit conversion from 'literal int' to 'int' changes value from -3000000000 to 1294967296
int val = -3000000000;
However, if the value is larger than the maximum positive value for a signed int, but fits into the equivalent bit-sized unsigned value limit, no such warning is emitted:
// no warning, because it fits into unsigned limit for same bit-sized int
int val = 3000000000;
I think we should emit a warning for this case.
The text was updated successfully, but these errors were encountered:
Generally, implicit casts from literal values that don't fit into the range of a target type will produce a warning and tell you the different value that will actually be used (based on truncation, etc...).
Here's an example:
However, if the value is larger than the maximum positive value for a signed int, but fits into the equivalent bit-sized unsigned value limit, no such warning is emitted:
I think we should emit a warning for this case.
The text was updated successfully, but these errors were encountered: