I learned that in x86_64 platform, the int
range is from -2,147,483,648
to 2,147,483,647
.
In c99, the min value of int max
is +32767
:
Their implementation-defined values shall be equal or greater in magnitude (absolute value) to those shown, with the same sign. Maximum value for an object of type int INT_MAX +32767
In glibc, it references POSIX specification:
{INT_MAX} Maximum value for an object of type int.
[CX] [Option Start] Minimum Acceptable Value: 2 147 483 647
my question
There are multiple documents defining the range of int
, they do not contradict each other, but who really defines the final int max value on a specific platform like x86_64?
I guess it is one of the following, but I do not know which one:
- the compiler, e.g. gcc/llvm
- glibc
- cpu company, e.g. intel