Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Common Data Models

Data Type

iAPX68

IA-16 32

IA-64

SPARC-64

ARM-32

Win64 Alpha

64-bit Linux, FreeBSD,
NetBSD, and OpenBSD

char

8

8

8

8

8

8

8

short

16

16

16

16

16

16

16

int

16

32

32

32

32

32

32

long

32

32

32

64

32

64

64

long long

N/A

64

64

64

64

64

64

pointer

16/32

32

64

64

32

64

64

Wiki Markup
Code frequently embeds assumptions about data models. For example, there are code bases that require pointer and {{long}} to have the same size, while other large code bases require {{int}} and {{long}} to be the same size \[[van de Voort 07|AA. C References#van de Voort 07]\]. These types of assumptions, while common, make the code difficult to port and make the ports error-prone. One solution is to avoid any implementation-defined behavior. However, this can result in inefficient code. Another solution is to include either static or runtime assertions near any platform-specific assumptions so they can be easily detected and corrected during porting.

...