![]() |
![]() |
![]() |
![]() |
Porting C code to the LP64 data model
The following list identifies some key points about porting C code to the LP64 data model:
- C long type grows to 64 bits
- C pointer types, e.g. char*, grow to 64 bits
- all other data types are unchanged from the 32-bit world
- C long and pointer types don't fit in a C int
- functions with no visible prototype are assumed to return int
- C long and pointer values are truncated to 32 bits when
- printf %d or %x formats are used instead of %ld or %lx
- ints are zero- or sign-extended to 64 bits when
- returned as a long or pointer type
![]() Model Technology Inc. Voice: (503) 641-1340 Fax: (503)526-5410 http://www.model.com sales@model.com |
![]() |
![]() |
![]() |
![]() |