In the following code, bitwise operations are performed on an 8-bit unsigned integer.
uint8_t i = 10;
uint8_t j = i>>2;
In this example, i
is promoted to a signed int
and value assigned to 8 bits unsigned int. Is it safe to int converted back to 8 bits unsigned int?