Re:Static Integer Types
by rssoconnor on Thursday July 01, 2021 @12:18PM
(#27700768)
Indeed. The trick here appears to be to write (1U*x << 31) so that 1U*x becomes a type that is the larger of uint32_least_t and unsigned int.
[ Parent
| on HN ]
Yup. Alternatively ((0U + x) << 31). I first thought about this problem years ago: https://stackoverflow.com/questions/39964651/is-masking-befo...