gh-83714: Fix a compiler warning in stat_nanosecond_timestamp() (#141043)

Disable the fast path on systems with 32-bit long.
This commit is contained in:
Victor Stinner 2025-11-05 18:31:35 +01:00 committed by GitHub
parent 579b2f8910
commit 30ab627aab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2634,11 +2634,14 @@ _posix_free(void *module)
static PyObject *
stat_nanosecond_timestamp(_posixstate *state, time_t sec, unsigned long nsec)
{
#if SIZEOF_LONG >= 8
/* 1677-09-21 00:12:44 to 2262-04-11 23:47:15 UTC inclusive */
if ((LLONG_MIN/SEC_TO_NS) <= sec && sec <= (LLONG_MAX/SEC_TO_NS - 1)) {
return PyLong_FromLongLong(sec * SEC_TO_NS + nsec);
}
else {
else
#endif
{
PyObject *ns_total = NULL;
PyObject *s_in_ns = NULL;
PyObject *s = _PyLong_FromTime_t(sec);