mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
gh-136006: fix Py_NAN expansion on Solaris systems (#136575)
Some checks are pending
Tests / (push) Blocked by required conditions
Tests / Windows MSI (push) Blocked by required conditions
Tests / Check if Autoconf files are up to date (push) Blocked by required conditions
Tests / Check if generated files are up to date (push) Blocked by required conditions
Tests / Change detection (push) Waiting to run
Tests / Docs (push) Blocked by required conditions
Tests / Ubuntu SSL tests with OpenSSL (push) Blocked by required conditions
Tests / Ubuntu SSL tests with AWS-LC (push) Blocked by required conditions
Tests / Android (aarch64) (push) Blocked by required conditions
Tests / Android (x86_64) (push) Blocked by required conditions
Tests / WASI (push) Blocked by required conditions
Tests / Hypothesis tests on Ubuntu (push) Blocked by required conditions
Tests / Address sanitizer (push) Blocked by required conditions
Tests / Sanitizers (push) Blocked by required conditions
Tests / Cross build Linux (push) Blocked by required conditions
Tests / CIFuzz (push) Blocked by required conditions
Tests / All required checks pass (push) Blocked by required conditions
Lint / lint (push) Waiting to run
mypy / Run mypy on Lib/_pyrepl (push) Waiting to run
mypy / Run mypy on Lib/test/libregrtest (push) Waiting to run
mypy / Run mypy on Lib/tomllib (push) Waiting to run
mypy / Run mypy on Tools/build (push) Waiting to run
mypy / Run mypy on Tools/cases_generator (push) Waiting to run
mypy / Run mypy on Tools/clinic (push) Waiting to run
mypy / Run mypy on Tools/jit (push) Waiting to run
mypy / Run mypy on Tools/peg_generator (push) Waiting to run
Some checks are pending
Tests / (push) Blocked by required conditions
Tests / Windows MSI (push) Blocked by required conditions
Tests / Check if Autoconf files are up to date (push) Blocked by required conditions
Tests / Check if generated files are up to date (push) Blocked by required conditions
Tests / Change detection (push) Waiting to run
Tests / Docs (push) Blocked by required conditions
Tests / Ubuntu SSL tests with OpenSSL (push) Blocked by required conditions
Tests / Ubuntu SSL tests with AWS-LC (push) Blocked by required conditions
Tests / Android (aarch64) (push) Blocked by required conditions
Tests / Android (x86_64) (push) Blocked by required conditions
Tests / WASI (push) Blocked by required conditions
Tests / Hypothesis tests on Ubuntu (push) Blocked by required conditions
Tests / Address sanitizer (push) Blocked by required conditions
Tests / Sanitizers (push) Blocked by required conditions
Tests / Cross build Linux (push) Blocked by required conditions
Tests / CIFuzz (push) Blocked by required conditions
Tests / All required checks pass (push) Blocked by required conditions
Lint / lint (push) Waiting to run
mypy / Run mypy on Lib/_pyrepl (push) Waiting to run
mypy / Run mypy on Lib/test/libregrtest (push) Waiting to run
mypy / Run mypy on Lib/tomllib (push) Waiting to run
mypy / Run mypy on Tools/build (push) Waiting to run
mypy / Run mypy on Tools/cases_generator (push) Waiting to run
mypy / Run mypy on Tools/clinic (push) Waiting to run
mypy / Run mypy on Tools/jit (push) Waiting to run
mypy / Run mypy on Tools/peg_generator (push) Waiting to run
On Solaris, `Py_NAN` may expand as a function address instead of a floating-point number.
This amends commit 7a3b03509e.
This commit is contained in:
parent
b9c50b4988
commit
d54b1091d4
2 changed files with 18 additions and 1 deletions
|
|
@ -57,9 +57,24 @@
|
|||
|
||||
/* Py_NAN: Value that evaluates to a quiet Not-a-Number (NaN). The sign is
|
||||
* undefined and normally not relevant, but e.g. fixed for float("nan").
|
||||
*
|
||||
* Note: On Solaris, NAN is a function address, hence arithmetic is impossible.
|
||||
* For that reason, we instead use the built-in call if available or fallback
|
||||
* to a generic NaN computed from strtod() as a last resort.
|
||||
*
|
||||
* See https://github.com/python/cpython/issues/136006 for details.
|
||||
*/
|
||||
#if !defined(Py_NAN)
|
||||
# define Py_NAN ((double)NAN)
|
||||
# if defined(__sun)
|
||||
# if _Py__has_builtin(__builtin_nanf)
|
||||
# define Py_NAN ((double)__builtin_nanf(""))
|
||||
# else
|
||||
# include <stdlib.h>
|
||||
# define Py_NAN (strtod("NAN", NULL))
|
||||
# endif
|
||||
# else
|
||||
# define Py_NAN ((double)NAN)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* Py_PYMATH_H */
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
On Solaris, the :c:macro:`!Py_NAN` macro now expands to a :c:type:`!double`
|
||||
instead of a function address. Patch by Bénédikt Tran.
|
||||
Loading…
Add table
Add a link
Reference in a new issue