GCC13, c++, cygwin 64:

auto x = 9223372036854775808L

gives the  warning: "integer constant is so large that it is unsigned"

But actually the type is signed __int128:

std::cout << x; 

gives the error: "ambiguous overload for ‘operator<<’ (operand types are 
‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘__int128’"

and

std::cout << (x-x-1<0) << std::endl;

prints 1.

So what is the correct type of  9223372036854775808L ?
unsigned long, as the warning says, or signed __int128?

Helmut

Reply via email to