Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

Type compatability between gcc and icc

sinate
Beginner
287 Views
Hi,
I have Red Hat EL4 with gcc 3.4.4 and icc 9.0 installed on an x86_64 system.
The type definition for uint64_t is "unsigned long" for icc and "unsigned long long" for gcc. Is there a way of getting these to match via some options on either compiler? Is one more correct than the other?
Thanks.
Steve.
0 Kudos
1 Reply
TimP
Honored Contributor III
287 Views
Here is an excerpt from a typical glibc stdint.h (glibc-2.3.3-118)

#if __WORDSIZE == 64
typedef unsigned long int uint64_t;
#else
__extension__
typedef unsigned long long int uint64_t;
#endif

My installations of icc 9.0 don't appear to be over-riding the definitions inherited from gcc. The claimed compatibility between icc and gcc requires they be the same. For icc on Windows, the "long long" has to be used for both 32- and 64-bit modes. In order for usage of stdint.h to be portable, you would have to be prepared for these variations.
0 Kudos
Reply