Closed edk0 closed 4 years ago
For posterity, the argument for the first approach here:
<deadk> iirc, we're using that to check if values are smaller than 32 or something
<deadk> the line of reasoning is: values smaller than 128 must be non-negative
signed chars, so the choice of negative number representation doesn't matter. apart
from the sign bit, signed integer types are required to have bit-for-bit
correspondence with their unsigned integer type, which means the only place the
sign bit can go is MSB. due to said correspondence, if the value is in the
non-negative
<deadk> signed char range, reinterpreting it as unsigned char can't change the
value. if it's in the negative signed char range, one of three things could happen
to the value, but it will always be at least 128 since it has MSB set
Now the commit ID makes sense. :)