Quantcast
Channel: Nikolay Igotti
Viewing all articles
Browse latest Browse all 30

ILP64, LP64, LLP64

$
0
0
One important platform feature, to be considered when writing portable 64-bit code is if it is LP64, LLP64 or ILP64. Those abbreviations stands for size in bits of basic C data types (int, long, void*, long long):

TypeILP64LP64LLP64
int643232
long646432
pointer646464
long long646464

Win64 is a LLP64 platform, while Solaris and Linux are LP64 platforms. Thus the only safe way to store pointers in integer types is either always use uintptr_t (defined in stdint.h not included at least with MSVC2003 and earlier), or always use long long fields.


Viewing all articles
Browse latest Browse all 30

Trending Articles