| November 2, 2008 11:00 PM PST | |
The size of a "long" integer varies between architectures and operating systems.
The Intel Compiler is compatible and inter-operable with Microsoft* Visual C++ on Windows* and with gcc* on Linux* and Mac OS X*. Consequently, the sizes of fundamental types are the same as for these compilers. The size of a long integer in particular depends on the operating system and the targeted architecture as follows:
OS arch size
Windows IA-32 4 bytes
Windows Intel 64 4 bytes
Windows IA-64 4 bytes
Linux IA-32 4 bytes
Linux Intel 64 8 bytes
Linux IA-64 8 bytes
Mac OS X IA-32 4 bytes
Mac OS X Intel 64 8 bytes
Consequently, when some programs that use "long" are ported from IA-32 Linux to Intel 64 Linux, or from Intel 64 Windows to Intel 64 Linux, the behavior might change. (Note that the size of pointers is expected to change between IA-32 and Intel 64).
Suggestion: If it is important to you for integer types to have the same size on all Intel platforms, then consider replacing "long" by either "int" or "long long". The size of the "int" integer type is 4 bytes and the size of the "long long" integer type is 8 bytes for all the above combinations of operating system and architecture.
This article applies to: Intel® C++ Compiler for Linux* Knowledge Base, Intel® C++ Compiler for Mac OS X* Knowledge Base, Intel® C++ Compiler for Windows* Knowledge Base
For more complete information about compiler optimizations, see our Optimization Notice.
Comments (2) 
| July 27, 2010 6:56 AM PDT
asmfan
|
Intel 64 - IA-32e (x86-64) IA-64 - Itanium |


Intel 64? IA-64?