[Python-checkins] bpo-33012: Add -Wno-cast-function-type for gcc 8. (GH-6757)
Miss Islington (bot)
webhook-mailer at python.org
Fri May 25 07:03:05 EDT 2018
https://github.com/python/cpython/commit/20b797dafa149afcdd7b64e489eb8ea1386d8eb4
commit: 20b797dafa149afcdd7b64e489eb8ea1386d8eb4
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018年05月25日T04:02:54-07:00
summary:
bpo-33012: Add -Wno-cast-function-type for gcc 8. (GH-6757)
(cherry picked from commit ef91ddeae79497fac25545dd68ee55a5a3c60e8d)
Co-authored-by: Serhiy Storchaka <storchaka at gmail.com>
files:
A Misc/NEWS.d/next/Build/2018-05-10-21-10-01.bpo-33012.5Zfjac.rst
M configure
M configure.ac
diff --git a/Misc/NEWS.d/next/Build/2018-05-10-21-10-01.bpo-33012.5Zfjac.rst b/Misc/NEWS.d/next/Build/2018-05-10-21-10-01.bpo-33012.5Zfjac.rst
new file mode 100644
index 000000000000..ecaa5c6117a0
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2018-05-10-21-10-01.bpo-33012.5Zfjac.rst
@@ -0,0 +1,2 @@
+Add ``-Wno-cast-function-type`` for gcc 8 for silencing warnings about
+function casts like casting to PyCFunction in method definition lists.
diff --git a/configure b/configure
index a707743b4966..f1f2daa3be99 100755
--- a/configure
+++ b/configure
@@ -7186,6 +7186,47 @@ $as_echo "$ac_cv_disable_missing_field_initializers" >&6; }
CFLAGS_NODIST="$CFLAGS_NODIST -Wno-missing-field-initializers"
fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can turn off $CC invalid function cast warning" >&5
+$as_echo_n "checking if we can turn off $CC invalid function cast warning... " >&6; }
+ ac_save_cc="$CC"
+ CC="$CC -Wcast-function-type -Werror"
+ if ${ac_cv_disable_cast_function_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ 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_cast_function_type=yes
+
+else
+
+ ac_cv_disable_cast_function_type=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ CC="$ac_save_cc"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_disable_cast_function_type" >&5
+$as_echo "$ac_cv_disable_cast_function_type" >&6; }
+
+ if test $ac_cv_disable_cast_function_type = yes
+ then
+ CFLAGS_NODIST="$CFLAGS_NODIST -Wno-cast-function-type"
+ fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can turn on $CC mixed sign comparison warning" >&5
$as_echo_n "checking if we can turn on $CC mixed sign comparison warning... " >&6; }
ac_save_cc="$CC"
diff --git a/configure.ac b/configure.ac
index 0ec09369a9a0..2e6d8500831a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1666,6 +1666,26 @@ yes)
CFLAGS_NODIST="$CFLAGS_NODIST -Wno-missing-field-initializers"
fi
+ AC_MSG_CHECKING(if we can turn off $CC invalid function cast warning)
+ ac_save_cc="$CC"
+ CC="$CC -Wcast-function-type -Werror"
+ AC_CACHE_VAL(ac_cv_disable_cast_function_type,
+ AC_COMPILE_IFELSE(
+ [
+ AC_LANG_PROGRAM([[]], [[]])
+ ],[
+ ac_cv_disable_cast_function_type=yes
+ ],[
+ ac_cv_disable_cast_function_type=no
+ ]))
+ CC="$ac_save_cc"
+ AC_MSG_RESULT($ac_cv_disable_cast_function_type)
+
+ if test $ac_cv_disable_cast_function_type = yes
+ then
+ CFLAGS_NODIST="$CFLAGS_NODIST -Wno-cast-function-type"
+ fi
+
AC_MSG_CHECKING(if we can turn on $CC mixed sign comparison warning)
ac_save_cc="$CC"
CC="$CC -Wsign-compare"
More information about the Python-checkins
mailing list