Cppreference.com claims:
If no length modifiers are present, it's guaranteed to have a width of at least 16 bits.
However, the latest standard draft only says:
Plain ints have the natural size suggested by the architecture of the execution environment.
With the footnote only adding that:
From these sections of the standards, it seems like int
's size is entirely implementation dependent. Where does the "16 bit minimum" guarantee come from?
The minimum size for int
follows from the requirement that INT_MIN
shall be no less than -32767
and INT_MAX
shall be at least +32767
. Note that that's 2^16-1 possible values, which allows for 1's complement with signed zero representation.