-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-46640: Py_NAN now uses the C99 NAN constant #31134
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
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.
lgtm
🤖 New build scheduled with the buildbot fleet by @vstinner for commit bd6b0bcb748514702feb5f542f718fa97b6d9d39 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
test_urllib2 failed on many buildbots: https://bugs.python.org/issue36019 |
That's true :( |
Misc/NEWS.d/next/Build/2022-02-04-21-26-50.bpo-46640.HXUmQp.rst
Outdated
Show resolved
Hide resolved
Building Python now requires a C99 <math.h> header file providing a NAN constant, or the __builtin_nan() built-in function. If a platform does not support Not-a-Number (NaN), the Py_NO_NAN macro can be defined in the pyconfig.h file.
I updated my PR:
|
For Python, a macro or function is the same. This change with this NEWS entry is already released: was moved to |
I looked at the machine code generated by
The
The
It seems like clang creates a private variable at |
|
Using |
The Windows SDK defines these macros in
ref: https://github.com/tpn/winsdk-10/blob/master/Include/10.0.16299.0/ucrt/corecrt_math.h It's similar to Python current definition of Py_NAN (simplified code):
|
* Building Python now requires a C99 ``<math.h>`` header file providing | ||
a ``NAN`` constant, or the ``__builtin_nan()`` built-in function. If a | ||
platform does not support Not-a-Number (NaN), the ``Py_NO_NAN`` macro can be | ||
defined in the ``pyconfig.h`` file. |
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.
It turns out that building under Py_NO_NAN
doesn't actually work right now. I've opened an issue: https://bugs.python.org/issue46656
Include/pymath.h
Outdated
@@ -56,24 +56,14 @@ | |||
* doesn't support NaNs. |
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.
With this change, the comment about INF*0
or INF/INF
working is out of date; that sentence should probably be removed.
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.
Needs a comment update, but otherwise LGTM. It turns out that Py_NO_NAN doesn't actually work right now, but that's a separate issue.
Merged. Thanks for the review @mdickinson! |
Building Python now requires a C99 <math.h> header file providing the
NAN constant.
https://bugs.python.org/issue46640