On Tue, 8 Aug 2023 at 10:09, Helmut Zeisel via Gcc <gcc@gcc.gnu.org> wrote:
>
> 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?

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84764 and
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96788

Reply via email to