I wonder how uint_fast8_t
can actually be mapped to any different type than the fixed-width uint8_t
type, and thus be faster.
Firstly, there doesn't have to be a uint8_t
type. On a 36-bit word addressed machine (they have existed), a char
would probably be 9 bits wide. (Word addressed means that the natural way to access memory is in words (of some size). Addressing sub-sections of a word requires shifting and masking, and pointers which address such sub-sections need additional bits to refer to the sub-unit within the word.)
On such a machine, the compiler author would have the interesting decision as whether to make uint_fast8_t
be the same as unsigned char
(9 bits) or the 36-bit unsigned int
type.
As others have said, there will be an implementation defined maximum of these types, and if you exceed that limit the unsigned types will wrap and the signed types will cause undefined behaviour.