Why is FxCop warning about an overflow (CA2233) in this C# code?
- by matt
I have the following function to get an int from a high-byte and a low-byte:
public static int FromBytes(byte high, byte low)
{
return high * (byte.MaxValue + 1) + low;
}
When I analyze the assembly with FxCop, I get the following critical warning:
CA2233: OperationsShouldNotOverflow
Arithmetic operations should not be done without first…