[GiNaC-devel] CLN and GiNaC patches for Win64 build

Richard B. Kreckel kreckel at in.terlu.de
Fri May 4 23:38:05 CEST 2018


On 05/02/2018 08:22 PM, Jan Rheinländer wrote:
> here's what the compiler says (sorry my system is German):
> 
> factor.cpp(2254): error C2440: "Initialisierung": "std::size_t" kann
> nicht in "GiNaC::numeric" konvertiert werden
> factor.cpp(2254): note: Quelltyp konnte von keinem Konstruktor
> angenommen werden, oder die Überladungsauflösung des Konstruktors ist
> mehrdeutig
> 
> The code in line 2254 is:
> 
> numeric modulus = (vnlst.nops() > 3) ? vnlst.nops() : 3;
> 
> It initializes a numeric from the return value of nops(), which is size_t.

So on Windos, where unsigned int is the same as unsigned long, the two
existing overloads of numeric ctor are ambiguous. Bummer.

It's better to convert these prototypes to uint32_t, uint64_t from
<cstdint> than add more overloads for size_t. This way, we need to
maintain two overloads, rather than three.

  -richy.


More information about the GiNaC-devel mailing list