]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-100340: Allows -Wno-int-conversion for wasm (GH-100341) (#106066)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 28 Jun 2023 07:27:59 +0000 (00:27 -0700)
committerGitHub <noreply@github.com>
Wed, 28 Jun 2023 07:27:59 +0000 (09:27 +0200)
(cherry picked from commit 75c8133efec035ec1083ebd8e7d43ef340c2e581)

Co-authored-by: Kushal Das <mail@kushaldas.in>
Misc/NEWS.d/next/Build/2023-01-17-21-32-51.gh-issue-100340.i9zRGM.rst [new file with mode: 0644]
Tools/wasm/config.site-wasm32-wasi
configure
configure.ac

diff --git a/Misc/NEWS.d/next/Build/2023-01-17-21-32-51.gh-issue-100340.i9zRGM.rst b/Misc/NEWS.d/next/Build/2023-01-17-21-32-51.gh-issue-100340.i9zRGM.rst
new file mode 100644 (file)
index 0000000..3a37f79
--- /dev/null
@@ -0,0 +1,2 @@
+Allows -Wno-int-conversion for wasm-sdk 17 and onwards, thus enables
+building WASI builds once against the latest sdk.
index 893a0d132cda591069f3ee6bf2b22f2c93e23f9c..fe6c90e59d67a21fd0425bcea2475628167a65de 100644 (file)
@@ -40,3 +40,6 @@ ac_cv_header_netpacket_packet_h=no
 # disable accept for WASM runtimes without sock_accept
 #ac_cv_func_accept=no
 #ac_cv_func_accept4=no
+
+# Disable int-conversion for wask-sdk as it triggers an error from version 17.
+ac_cv_disable_int_conversion=yes
index 03aa078c30f8cf9f06093f9c03bf7a57edc44e6a..d686e09d81c2dd9d8a26281e82fa0892389ee1ac 100755 (executable)
--- a/configure
+++ b/configure
@@ -8454,6 +8454,44 @@ fi
 
 
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can disable $CC int-conversion warning" >&5
+$as_echo_n "checking if we can disable $CC int-conversion warning... " >&6; }
+if ${ac_cv_disable_int_conversion_warning+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    py_cflags=$CFLAGS
+    as_fn_append CFLAGS "-Wint-conversion -Werror"
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_disable_int_conversion_warning=yes
+else
+  ac_cv_disable_int_conversion_warning=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    CFLAGS=$py_cflags
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_disable_int_conversion_warning" >&5
+$as_echo "$ac_cv_disable_int_conversion_warning" >&6; }
+
+
+    if test "x$ac_cv_disable_int_conversion" = xyes; then :
+  CFLAGS_NODIST="$CFLAGS_NODIST -Wno-int-conversion"
+fi
+
+
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can disable $CC missing-field-initializers warning" >&5
 $as_echo_n "checking if we can disable $CC missing-field-initializers warning... " >&6; }
 if ${ac_cv_disable_missing_field_initializers_warning+:} false; then :
index 1c25abd65a073a86d16557e8d114b689c687914d..35026f7a2369a77fefa07aa72ae5ff0c1a8735cc 100644 (file)
@@ -2246,6 +2246,10 @@ yes)
     AS_VAR_IF([ac_cv_disable_unused_parameter_warning], [yes],
               [CFLAGS_NODIST="$CFLAGS_NODIST -Wno-unused-parameter"])
 
+    PY_CHECK_CC_WARNING([disable], [int-conversion])
+    AS_VAR_IF([ac_cv_disable_int_conversion], [yes],
+              [CFLAGS_NODIST="$CFLAGS_NODIST -Wno-int-conversion"])
+
     PY_CHECK_CC_WARNING([disable], [missing-field-initializers])
     AS_VAR_IF([ac_cv_disable_missing_field_initializers_warning], [yes],
               [CFLAGS_NODIST="$CFLAGS_NODIST -Wno-missing-field-initializers"])