I am using Linux x86_64 with gcc 5.2.1 and I am using a code to ascertain the maximum value for \"unsigned long long\" variable in C programming language.
In my machine,
Your code is correct and this is a bogus warning.
To avoid the warning you could write:
unsigned long long a = 18446744073709551615ull;
The warning is (slightly) useful for some integer literals, but not this particular one, and the compiler is not trying very hard to limit the warning to cases where it is useful.
NB. Make sure you're using -std=c99
or -gnu99
or later; before 1999 C did not officially have unsigned long long
, and different compilers did weird things with large integer literals.