Standard C specifies two relevant criteria:
sizeof(char) ≤ sizeof(short) ≤ sizeof(int) ≤ sizeof(long) ≤ sizeof(long long) ≤ sizeof(uintmax_t)
This is indirectly indicated in ISU / IEC 9899: 2011, §6.2.5 Types, ¶8: for any two integer types with the same degree of correspondence and another integer conversion (see 6.3.1.1), the range of values of the type with a lower integer conversion rank the subrange of values of another type is equal.
Minimum allowed value for maximum types (ISO / IEC 9899: 2011, §5.2.4.2.1 Dimensions of integer types <limits.h> ):
SCHAR_MAX ≥ 127 // 2 7 -1SHRT_MAX ≥ 32.767 // 2 15 -1INT_MAX ≥ 32,767 // 2 15 -1LONG_MAX ≥ 2,147,483,647 // 2 31 -1LLONG_MAX ≥ 9,223,372,036,854,775,807 // 2 63 -1
The quote is formally correct; you can develop systems in which long does not store a larger range than int - indeed, this applies to most 32-bit systems (all that I know about), and also applies to Windows 64. This is less likely to be exact wrt long long ; I don’t know the system where sizeof(int) == sizeof(long long) (and due to the given inequality sizeof(int) == sizeof(long) ). On most 64-bit Unix systems, sizeof(int) == 4 , sizeof(long) == 8 and sizeof(long long) == 8 ; on Windows 64, sizeof(long) == 4 and only long long (or __int64 ) is a 64-bit type.
source share