summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-05-25 13:16:51 +0300
committerGitHub <noreply@github.com>2018-05-25 13:16:51 +0300
commitef91ddeae79497fac25545dd68ee55a5a3c60e8d (patch)
tree0dc17d8800827ea6da651a993bb8204b1d462d37 /configure.ac
parent82d727fce68577d9f44f9ecfaf20bd4581a66404 (diff)
downloadcpython-git-ef91ddeae79497fac25545dd68ee55a5a3c60e8d.tar.gz
bpo-33012: Add -Wno-cast-function-type for gcc 8. (GH-6757)
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac20
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 59489047fc..11fc7e545d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1660,6 +1660,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"