...
| Code Block | ||
|---|---|---|
| ||
class CastAway {
public static void workWith(int i) {
byte b = (byte)(i % 0x10000L0x100); // 2^8;
// work with b
}
}
|
...
INT31-C. Ensure that integer conversions do not result in lost or misinterpreted data | |
| FLP34-C. Ensure that floating-point conversions are within range of the new type |
VOID INT31-CPP. Ensure that integer conversions do not result in lost or misinterpreted data | |
| VOID FLP34-CPP. Ensure that floating point conversions are within range of the new type |
Numeric Conversion Errors [FLC] | |
CWE-681. Incorrect conversion between numeric types | |
| CWE-197. Numeric truncation error |
...