Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] C compatiblity fixes for the configure script (incompatible-pointer-types)
- X-seq: zsh-workers 52383
- From: Florian Weimer <fweimer@xxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] C compatiblity fixes for the configure script (incompatible-pointer-types)
- Date: Fri, 08 Dec 2023 21:58:07 +0100
- Archived-at: <https://zsh.org/workers/52383>
- List-id: <zsh-workers.zsh.org>
Avoid incompatible pointer types in terminfo global variable checks.
Some compilers reject these incompatible pointer types, causing the
checks to always fail, when these variables are in fact available.
Related to:
<https://fedoraproject.org/wiki/Changes/PortingToModernC>
<https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
diff --git a/configure.ac b/configure.ac
index a58242f453b4a8f3..5534f42df14eb28c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1769,27 +1769,27 @@ if test x$zsh_cv_path_term_header != xnone; then
fi
AC_MSG_CHECKING(if boolcodes is available)
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = boolcodes; puts(*test);]])],[AC_DEFINE(HAVE_BOOLCODES) boolcodes=yes],[boolcodes=no])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)boolcodes; puts(*test);]])],[AC_DEFINE(HAVE_BOOLCODES) boolcodes=yes],[boolcodes=no])
AC_MSG_RESULT($boolcodes)
AC_MSG_CHECKING(if numcodes is available)
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = numcodes; puts(*test);]])],[AC_DEFINE(HAVE_NUMCODES) numcodes=yes],[numcodes=no])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)numcodes; puts(*test);]])],[AC_DEFINE(HAVE_NUMCODES) numcodes=yes],[numcodes=no])
AC_MSG_RESULT($numcodes)
AC_MSG_CHECKING(if strcodes is available)
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = strcodes; puts(*test);]])],[AC_DEFINE(HAVE_STRCODES) strcodes=yes],[strcodes=no])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)strcodes; puts(*test);]])],[AC_DEFINE(HAVE_STRCODES) strcodes=yes],[strcodes=no])
AC_MSG_RESULT($strcodes)
AC_MSG_CHECKING(if boolnames is available)
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = boolnames; puts(*test);]])],[AC_DEFINE(HAVE_BOOLNAMES) boolnames=yes],[boolnames=no])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)boolnames; puts(*test);]])],[AC_DEFINE(HAVE_BOOLNAMES) boolnames=yes],[boolnames=no])
AC_MSG_RESULT($boolnames)
AC_MSG_CHECKING(if numnames is available)
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = numnames; puts(*test);]])],[AC_DEFINE(HAVE_NUMNAMES) numnames=yes],[numnames=no])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)numnames; puts(*test);]])],[AC_DEFINE(HAVE_NUMNAMES) numnames=yes],[numnames=no])
AC_MSG_RESULT($numnames)
AC_MSG_CHECKING(if strnames is available)
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = strnames; puts(*test);]])],[AC_DEFINE(HAVE_STRNAMES) strnames=yes],[strnames=no])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)strnames; puts(*test);]])],[AC_DEFINE(HAVE_STRNAMES) strnames=yes],[strnames=no])
AC_MSG_RESULT($strnames)
dnl There are apparently defective terminal library headers on some
Messages sorted by:
Reverse Date,
Date,
Thread,
Author