https://github.com/python/cpython/commit/2271fbb369a78fcd3ac00c526ca6711140144e43
commit: 2271fbb369a78fcd3ac00c526ca6711140144e43
branch: main
author: Sergey B Kirpichev <[email protected]>
committer: vstinner <[email protected]>
date: 2026-09-02T17:21:22+02:00
summary:

gh-153740: Refine test for _Float16: check support from libm (#156815)

files:
M configure
M configure.ac

diff --git a/configure b/configure
index e0ad04b036aeb1..a2ca40de07d54e 100755
--- a/configure
+++ b/configure
@@ -16745,12 +16745,14 @@ else case e in #(
   e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+#include <math.h>
 int main(void)
 {
     _Float16 val = 1.0f16;
+    int test = isinf(val) || isnan(val); /* basic support from libm */
     double d = 3.14;
     val = d;
-    return 0;
+    return test;
 }
 
 _ACEOF
diff --git a/configure.ac b/configure.ac
index 2b8a5b052878c9..e1333230fefa68 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4474,12 +4474,14 @@ AC_CACHE_CHECK([for _Float16 support], 
[ac_cv_float16_supported],
 WITH_SAVE_ENV([
 CFLAGS="$CFLAGS -O0"
 AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <math.h>
 int main(void)
 {
     _Float16 val = 1.0f16;
+    int test = isinf(val) || isnan(val); /* basic support from libm */
     double d = 3.14;
     val = d;
-    return 0;
+    return test;
 }
 ]])], [ac_cv_float16_supported=yes],
 [ac_cv_float16_supported=no],

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to