Constructor taking 64-bit integer missing on (some) Windows C++ compilers

Hans Åberg haberg-1 at telia.com
Mon Jun 8 22:02:20 UTC 2020


> On 6 Jun 2020, at 06:28, Mihai Preda <mpreda at gmail.com> wrote:
> 
> At this point the C++ compiler on windows (where long is 32-bit)
> reports errors, see at the end. The problem is that the set of
> constructors does not include one taking a 64-bit integer:
> 
> #define __GMPXX_DEFINE_ARITHMETIC_CONSTRUCTORS        \
>  __gmp_expr(signed char c) { init_si(c); }        \
>  __gmp_expr(unsigned char c) { init_ui(c); }        \
>  __gmp_expr(signed int i) { init_si(i); }        \
>  __gmp_expr(unsigned int i) { init_ui(i); }        \
>  __gmp_expr(signed short int s) { init_si(s); }    \
>  __gmp_expr(unsigned short int s) { init_ui(s); }    \
>  __gmp_expr(signed long int l) { init_si(l); }        \
>  __gmp_expr(unsigned long int l) { init_ui(l); }    \
>  __gmp_expr(float f) { init_d(f); }            \
>  __gmp_expr(double d) { init_d(d); }
> 
> Among all in the list above, none takes a uint64_t or int64_t.

Those types are just typedefs to the appropriate C types [1], and with those compilers one would have to use [unsigned/signed] long long [2], which is not on the list. So it would suffice adding those, it would seem.

1. https://en.cppreference.com/w/cpp/types/integer
2. https://en.cppreference.com/w/cpp/language/types




More information about the gmp-bugs mailing list