From 80295a8f9b624c8d962b1df6bc9b89049e11bcf5 Mon Sep 17 00:00:00 2001 From: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> Date: Fri, 18 Apr 2025 10:45:30 +0200 Subject: GH-131296: fix clang-cl warning on Windows in `Objects/longobject.c` for 32bit builds (#131604) --- Objects/longobject.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Objects/longobject.c b/Objects/longobject.c index 692312c..ffb3f95 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -909,7 +909,9 @@ _PyLong_NumBits(PyObject *vv) assert(ndigits == 0 || v->long_value.ob_digit[ndigits - 1] != 0); if (ndigits > 0) { digit msd = v->long_value.ob_digit[ndigits - 1]; +#if SIZEOF_SIZE_T == 8 assert(ndigits <= INT64_MAX / PyLong_SHIFT); +#endif result = (int64_t)(ndigits - 1) * PyLong_SHIFT; msd_bits = bit_length_digit(msd); result += msd_bits; -- cgit v0.12