-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
gh-83714: Fix compiler warning in stat_nanosecond_timestamp() #141043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Disable the fast path on systems with 32-bit long.
|
!buildbot x86 Debian |
|
🤖 New build scheduled with the buildbot fleet by @vstinner for commit c86068e 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F141043%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
|
https://buildbot.python.org/#/builders/1285/builds/530 confirms that the compiler warnings on |
|
On 32-bit, the fast path is not interesting, it only covers seconds in the range [-3; 2]: |
| static PyObject * | ||
| stat_nanosecond_timestamp(_posixstate *state, time_t sec, unsigned long nsec) | ||
| { | ||
| #if SIZEOF_LONG >= 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this is correct. The comparison is always true, not always false if SIZEOF_LONG < 8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind to elaborate? I'm not sure that I understand your remark. What do you suggest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, if SIZEOF_LONG < 8, the fast path PyLong_FromLongLong(sec * SEC_TO_NS + nsec) was always used. Now it is never used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote a different fix: #141069
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that I now understood my mistake. Sorry about that :-( I read LONG_MIN (32-bit) instead of LLONG_MIN (64-bit).
Disable the fast path on systems with 32-bit long.