It depends on the combination of compiler, processor and OS.
For example, on a 64-bit Intel processor in 64-bit mode, the long int size on Windows is 4 bytes, and on Linux and Mac it is 8 bytes. int - 4 bytes in all three operating systems on Intel.
The compiler developer also has a choice, but usually uses what the OS uses. But it is entirely possible that a compiler provider that has C compilers for all three platforms decides to use the same sizes in all three.
Of course, it makes no sense to do int 4 bytes (although that would be possible) on a 16-bit processor.
So it depends on all three things that you mention.
source share