J
John Black
Hi,
If I have many integer calculation in my code, what's the best way to
detect integer overflow?
unsigned int i1 = 0xFFFFFF00, i2 = 0xFFFF;
then in statement unsigned int i3 = i1 + i2; there is overflow and
the result is not what I want. If such sum calculation scatters around
my code, I wonder what's the best way to catch it?
Thanks.
If I have many integer calculation in my code, what's the best way to
detect integer overflow?
unsigned int i1 = 0xFFFFFF00, i2 = 0xFFFF;
then in statement unsigned int i3 = i1 + i2; there is overflow and
the result is not what I want. If such sum calculation scatters around
my code, I wonder what's the best way to catch it?
Thanks.