Description
DEFINE_SAFE_ADD checks if "Augend + Addend >= Augend" to detect overflow. However arithmetic operations involve integer promotions, so e.g. (UINT8)255 + (UINT8)1 is 256 instead of 0. The check needs a cast back to the source type
DEFINE_SAFE_ADD checks if "Augend + Addend >= Augend" to detect overflow. However arithmetic operations involve integer promotions, so e.g. (UINT8)255 + (UINT8)1 is 256 instead of 0. The check needs a cast back to the source type