diff options
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r-- | Objects/longobject.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c index 660824f..e805dac 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -771,7 +771,10 @@ _PyLong_Sign(PyObject *vv) static int bit_length_digit(digit x) { - Py_BUILD_ASSERT(PyLong_SHIFT <= sizeof(unsigned long) * 8); + // digit can be larger than unsigned long, but only PyLong_SHIFT bits + // of it will be ever used. + static_assert(PyLong_SHIFT <= sizeof(unsigned long) * 8, + "digit is larger than unsigned long"); return _Py_bit_length((unsigned long)x); } @@ -5647,7 +5650,7 @@ popcount_digit(digit d) { // digit can be larger than uint32_t, but only PyLong_SHIFT bits // of it will be ever used. - Py_BUILD_ASSERT(PyLong_SHIFT <= 32); + static_assert(PyLong_SHIFT <= 32, "digit is larger than uint32_t"); return _Py_popcount32((uint32_t)d); } |