mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
config: check for -Wno-cast-function-type
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Rich Ercolani <rincebrain@gmail.com> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #13145 Closes #13152
This commit is contained in:
@@ -181,6 +181,32 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_CLOBBERED], [
|
||||
AC_SUBST([NO_CLOBBERED])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Check if gcc supports -Wno-cast-function-type option.
|
||||
dnl #
|
||||
dnl # We actually invoke gcc with the --cast-function-type option
|
||||
dnl # and infer the 'no-' version does or doesn't exist based upon
|
||||
dnl # the results. This is required because when checking any of
|
||||
dnl # no- prefixed options gcc always returns success.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_CAST_FUNCTION_TYPE], [
|
||||
AC_MSG_CHECKING([whether $CC supports -Wno-cast-function-type])
|
||||
|
||||
saved_flags="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror -Wcast-function-type"
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
|
||||
NO_CAST_FUNCTION_TYPE=-Wno-cast-function-type
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
NO_CAST_FUNCTION_TYPE=
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
|
||||
CFLAGS="$saved_flags"
|
||||
AC_SUBST([NO_CAST_FUNCTION_TYPE])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Check if gcc supports -Wimplicit-fallthrough option.
|
||||
dnl #
|
||||
|
||||
@@ -210,6 +210,7 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
|
||||
AC_SUBST(CPU_COUNT)
|
||||
|
||||
ZFS_AC_CONFIG_ALWAYS_CC_NO_CLOBBERED
|
||||
ZFS_AC_CONFIG_ALWAYS_CC_NO_CAST_FUNCTION_TYPE
|
||||
ZFS_AC_CONFIG_ALWAYS_CC_IMPLICIT_FALLTHROUGH
|
||||
ZFS_AC_CONFIG_ALWAYS_CC_FRAME_LARGER_THAN
|
||||
ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_TRUNCATION
|
||||
|
||||
Reference in New Issue
Block a user