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

64-bit integer

Dan4
Beginner
591 Views
Dear all,

I am wondering if there is any way (flag, compiler option?) to force the Intel compiler to assume that all integers in a code are 64-bit integers. Is there any way? I would be thankful.

Regards,

Dan
0 Kudos
3 Replies
TimP
Honored Contributor III
591 Views
No such supported compiler option in C or C++ (check the docs for equivalent ifort option). Usual way is to define such variables with a local type, e.g. MYINT64,MYUINT64 and use e.g.
#include
typedef int_64t MYINT64
typedef uint_64t MYUINT64

Apparently, the relevant standard headers may not be supported for 32-bit Windows (where you must make appropriate change to your typedef), but should be present in 64-bit VS2010 as well as many years of linux.
0 Kudos
TimP
Honored Contributor III
591 Views
If you set the architecture x64 in Windows then all integers are set to 64 bit length.

You will still need to use 64-bit integer definitions for that to happen.
0 Kudos
Georg_Z_Intel
Employee
591 Views
Hello,

I'm adding some information to Tim's first reply:

The best and standards conform (C99) solution is to use stdint.h. In your case you'd like to use types int_64t & uint_64t.
Older versions of Visual Studio (before 2010) don't have such a header.
However, the Intel compiler comes with this header included and hence you won't need to define your own types if you use it.
Thus using stdint.h with Intel compiler should be easy, reliable and even portable (e.g. from Windows to Linux). You only need to take care when using another compiler instead (depends on how this compiler conforms to C99 then).

Best Regards,

Georg
0 Kudos
Reply