Yes, the result of the first shift is signed. signed int
specifically. Check out the rules for the "integer promotions" in the C spec:
If an int
can represent all values of the original type ... the value is converted to an int
...
So, since your int
- usually a range of [-231, 231) - can represent all the values of unsigned char
- usually [0, 255] - it's converted to int
, and the <<
and >>
take place on the resulting values.