Thanks to Brian Minton for reporting the problem:
I'm using gcc version 8.3.0 (Debian 8.3.0-6). The system is x86_64
with 8 GB ram. When I try to build the source, with make, I get the
following error:
...
In file included from lib/bup/_helpers.c:69:
lib/bup/_helpers.c: In function 'bitmatch':
.../src/bup/src/bup/intprops.h:626:22: error: comparison of
integer expressions of different signedness: 'long long unsigned int' and
'Py_ssize_t' {aka 'long int'} [-Werror=sign-compare]
: (tmax) / (b) < (a)))
^
.../src/bup/src/bup/intprops.h:427:10: note: in expansion of
macro '_GL_INT_MULTIPLY_RANGE_OVERFLOW'
&& _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1)) \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../src/bup/src/bup/intprops.h:655:36: note: in expansion of
macro 'INT_MULTIPLY_WRAPV'
#define INT_MULTIPLY_OK(a, b, r) ! INT_MULTIPLY_WRAPV (a, b, r)
^~~~~~~~~~~~~~~~~~
lib/bup/_helpers.c:624:10: note: in expansion of macro 'INT_MULTIPLY_OK'
if (!INT_MULTIPLY_OK(byte, 8, &result)
^~~~~~~~~~~~~~~
And to Mark J Hewitt for reporting the issue on a 32-bit Raspberry Pi
system.
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
}
}
- unsigned long long result;
+ Py_ssize_t result;
if (!INT_MULTIPLY_OK(byte, 8, &result)
|| !INT_ADD_OK(result, bit, &result))
{
PyErr_Format(PyExc_OverflowError, "bitmatch bit count too large");
return NULL;
}
- return PyLong_FromUnsignedLongLong(result);
+ return PyLong_FromSsize_t(result);
}