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

Force 64 bit integers?

tiberius
Beginner
325 Views
My application allocates several large arrays. Unfortunately, the allocating and accessing code always uses ints. This has limited the size of array that can be allocated.

I was wondering if there are any compiler options available that would simply force an int to be 64 bit. I would take a small memory hit overall, but it would help me avoid many weeks of work.

Thanks!
0 Kudos
3 Replies
levicki
Valued Contributor I
325 Views

I must admit that I do not understand what you want.

What forces you to use int as array index? You can use __int64 or simply increment a pointer if the array is accessed sequentially. As for allocation, you can always use VirtualAlloc() for large allocations instead of new[] operator.

0 Kudos
AndreyKarpov
New Contributor I
325 Views

If you mean kind errors - http://www.viva64.com/help/V108.html

You can easily find and correct all wrong types, using tool Viva64 (http://www.viva64.com/download.php)

0 Kudos
TimP
Honored Contributor III
325 Views
Original post seems to ask for something analogous to -i8 option of ifort. I have run into customers who insist they cannot support platforms where sizeof(int) != sizeof(size_t) even though C has not supported this assertion since size_t was implemented 20 years ago.
0 Kudos
Reply