Skip to content

Commit 30ab627

Browse files
authored
gh-83714: Fix a compiler warning in stat_nanosecond_timestamp() (#141043)
Disable the fast path on systems with 32-bit long.
1 parent 579b2f8 commit 30ab627

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Modules/posixmodule.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2634,11 +2634,14 @@ _posix_free(void *module)
26342634
static PyObject *
26352635
stat_nanosecond_timestamp(_posixstate *state, time_t sec, unsigned long nsec)
26362636
{
2637+
#if SIZEOF_LONG >= 8
26372638
/* 1677-09-21 00:12:44 to 2262-04-11 23:47:15 UTC inclusive */
26382639
if ((LLONG_MIN/SEC_TO_NS) <= sec && sec <= (LLONG_MAX/SEC_TO_NS - 1)) {
26392640
return PyLong_FromLongLong(sec * SEC_TO_NS + nsec);
26402641
}
2641-
else {
2642+
else
2643+
#endif
2644+
{
26422645
PyObject *ns_total = NULL;
26432646
PyObject *s_in_ns = NULL;
26442647
PyObject *s = _PyLong_FromTime_t(sec);

0 commit comments

Comments
 (0)