Aug
16
This kind of compiler error happens when an integer is too large to be stored in a single 32-bit register. A common situation is when a user is compiling 64-bit optimized code on a 32-bit machine. Therefore, one register of the 64-bit machine has size of two registers of a 32-bit machine. So, in order to compile integer that long, the user has to inform the processor that the integer has to be stored on two 32-bit registers (all together, 64 bits).
Commonly, the type of the integer can be changed to “long long int”
Example:
long long int var = 10000000000;
Another option is specifying the type using the suffix LL.
int var = 10000000000LL;
There are other suffixes available. For instance, if the variable is unsigned (cannot contain negative values,but can store values of larger magnitude than the signed type), you can safely use the suffix LLU.
Example:
int var = 10000000000LLU;