On Jul 31, 3:19 pm, mattia <ger...@gmail.comwrote:
Hi all, I've got to use this declaration:
unsigned long h = 2166136261;
but the gcc compiler warns me saying "warning: this decimal constant is
unsigned only in ISO C90".
What should I do?
unsigned long h = 2166136261UL;
should get rid of the warning.
What it means is that let's call your number x, x is greater than
LONG_MAX.
In C90, 'long' is the largest signed integer type. Since x cannot be
represented by long, but it can be represented by unsigned long, x
will be unsigned.
In C99, x can fit in 'long long', so in C99, x will be 'long long'.
'UL' specifies that it has to be unsigned long.