> Am 25.05.2020 um 23:57 schrieb Riccardo Mottola <riccardo.mott...@libero.it>:
> 
> What is interesting, if gdb follows the same literal rules and promotions of 
> GCC:
> 
> (gdb) p  (int64_t)-2147483648
> $8 = 2147483648
> (gdb) p  (int64_t)-2147483648l
> $9 = 2147483648
> (gdb) p  (int64_t)-2147483648L
> $10 = 2147483648
> 
> (gdb) p  (int64_t)-2147483647
> $15 = -2147483647
> 
> Whatever I do as a literal suffix, it comes out positive. One value less and 
> it works.

Well, you've missed out the one that should have worked :-)
 -2147483648LL
Note that suffix L mark a long value, which is just 32 bits on a 32-bit system 
the long type. So to get a 64-bit literal you need to ask for a long long value.

Wolfgang


Reply via email to