Previously, success was due to the flexibility of adapting to almost all existing architecture options
@John Hascall with: 1) own integer sizes 8, 16, 18, 24, 32, 36, etc. Bit,
2) varieties with a sign of integers: 2 additions, 1 addition, a signed integer and 3) various finite, large, small and
others .
As coding developed, algorithms and data exchange were advanced for more uniformity and, therefore, for types that corresponded to 1 and 2 above the platforms. Encoders rolled as typedef int int32 inside #if ... Many variations that created the soup, as noted by the OP.
C99 introduced (u)int_leastN_t, (u)int_fastN_t, (u)intmax_t to make portable, but somewhat minimal types of bit widths. These types are necessary for N = 8,16,32,64.
Also introduced are semi-optional types (see below **), such as (u)intN_t , which has additional attributes, they must be 2 additions and without filling. It is these popular types that are so widely desired and used to grind whole soup.
how did programmers expect to use C-integer types?
Writing flexible code that does not depend much on bit width. It is fairly easy to encode strtol() using only LONG_MIN, LONG_MAX without taking into account the encoding for the width of the bits / endian / integer.
However, many coding tasks require precise width types and 2 extras for simple high-performance coding. It is better in this case to abandon portability to 36-bit machines and 32-bit values ββof signed values ββand stick to 2 N wide (2 additions for signed) integers. Various CRC and cryptographic algorithms and file formats come to mind. Thus, the need for fixed-width types and a predefined (C99) way to do this.
Today there are still gotchas that still need to be managed. Example. Conventional int/unsigned promotions lose control, as these types can be 16, 32, or 64.
**
These types are optional. However, if an implementation provides integer types with a width of 8, 16, 32, or 64 bits, without padding bits and (for signed types) that have a representation with two additions, it must specify the corresponding typedef names. C11 7.20.1.1 Integer types of exact width 3