Closed rljacobson closed 2 months ago
Out of curiosity, are there many people running Maude on 32-bit platforms?
I've made your suggested change in Alpha152. I'm reluctant to accept pull requests on this repository in case it breaks my script for updating it from a private development repository.
That last bug report I have with respect to i386 was on 11/28/20 by a Debian maintainer rather than a user. People have built Maude on a Raspberry Pi but that is hardly recommended for serious use.
On some platforms, an assignment to a
const mpz_class
results in a "no overload" error foroperator=
(assignment operator). The error is triggered when it is not true thatSIZEOF_UNSIGNED_LONG == 8
, e.g. on 32-bit architectures.The context is small enough to reproduce in its entirety here:
It looks like just a copy+paste error, because
number
doesn't need to beconst
here. Excruciating details are given in the next paragraph, which you're welcome to skip over.The issue is in the
#else
preprocessor branch, where it is assumed thatunsigned long
is 32 bits. The "hack" is to load the value of the 64-bit parameternat
into anmpz_class
number
32 bits at a time by first loading the high 32 bits into the lower 32 bits ofnumber
, shiftingnumber
left by 32, and then loading the low 32 bits ofnat
into the now zeroed lower 32 bits ofnumber
. These steps require at least two assignments tonumber
, which is prohibited by theconst
.The fix is to remove the
const
.