Linux kernel booting process, part 3
github.com
github.com
| Type | char | short | int | long | u8 | u16 | u32 | u64 |
|------|------|-------|-----|------|----|-----|-----|-----|
| Size | 1 | 2 | 4 | 8 | 1 | 2 | 4 | 8 |
Here are the corrected tables, now a relic of history:
32 bit:
| Type | char | short | long | int | u8 | u16 | u32 | u64 |
|------|------|-------|-----|------|----|-----|-----|-----|
| Size | 1 | 2 | 4 | 4 | 1 | 2 | 4 | 8 |
64 bit:
| Type | char | short | long | int | u8 | u16 | u32 | u64 |
|------|------|-------|-----|------|----|-----|-----|-----|
| Size | 1 | 2 | 4 | 8 | 1 | 2 | 4 | 8 |
Instead we traded convention for programmer convenience, so that companies like Apple could mandate 64 bit binaries under the pretense that programmers wouldn’t have to do much work to convert from 32 (since they mistakingly kept int 4 bytes).
The fact is that originally long was 4 bytes and int was the native width of your processor (int should be 8 on most CPUs today, as they are 64 bit). Using long before a term like int doubled the length and created confusion as well.
Also, it's unclear from your post, but to clarify: the C standard mandates that sizeof(int) <= sizeof(long).