What decides the sizeof an integer?

Taken from http://en.wikipedia.org/wiki/64-bit (under 64-bit data models)

There are various models, Microsoft decided that sizeof(int) == 4, some (a few) others didn’t.

HAL Computer Systems port of Solaris to SPARC64 and Unicos seem to be the only ones where sizeof(int) == 8. They are called ILP64 and SILP64 models.

The true “war” was for sizeof(long), where Microsoft decided for sizeof(long) == 4 (LLP64) while nearly everyone else decided for sizeof(long) == 8 (LP64).

Note that in truth it’s the compiler that “decides” which model to use, but as written in the wiki

Note that a programming model is a choice made on a per-compiler basis, and several can coexist on the same OS. However, the programming model chosen as the primary model for the OS API typically dominates.

Leave a Comment