◐ Shell
clean mode source ↗

bpo-39277: Fix PY_TIMEOUT_MAX cast in _threadmodule.c by vstinner · Pull Request #31195 · python/cpython

Cast PY_TIMEOUT_MAX to double, not to _PyTime_t.

Fix the clang warning:

Modules/_threadmodule.c:1648:26: warning: implicit conversion from
'_PyTime_t' (aka 'long') to 'double' changes value from
9223372036854775 to 9223372036854776
[-Wimplicit-const-int-float-conversion]
double timeout_max = (_PyTime_t)PY_TIMEOUT_MAX * 1e-6;
^~~~~~~~~~~~~~~~~~~~~~~~~ ~

https://bugs.python.org/issue39277