Skip to content

Commit d3e53bc

Browse files
authored
bpo-39277: Fix PY_TIMEOUT_MAX cast in _threadmodule.c (GH-31195)
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; ^~~~~~~~~~~~~~~~~~~~~~~~~ ~
1 parent 4b603f6 commit d3e53bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/_threadmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,7 @@ thread_module_exec(PyObject *module)
16451645
}
16461646

16471647
// TIMEOUT_MAX
1648-
double timeout_max = (_PyTime_t)PY_TIMEOUT_MAX * 1e-6;
1648+
double timeout_max = (double)PY_TIMEOUT_MAX * 1e-6;
16491649
double time_max = _PyTime_AsSecondsDouble(_PyTime_MAX);
16501650
timeout_max = Py_MIN(timeout_max, time_max);
16511651
// Round towards minus infinity

0 commit comments

Comments
 (0)