Fix C compatibility issue in the configure script

Related to:

  <https://fedoraproject.org/wiki/Changes/PortingToModernC>
  <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
This commit is contained in:
Florian Weimer 2023-12-08 21:54:47 +01:00
parent 47d6eba90a
commit 82b6281e8c
2 changed files with 49 additions and 1 deletions

44
zsh-configure-c99.patch Normal file
View File

@ -0,0 +1,44 @@
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.
Submitted upstream: <https://www.zsh.org/mla/workers/2023/msg01112.html>
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

View File

@ -1,7 +1,7 @@
Summary: Powerful interactive shell Summary: Powerful interactive shell
Name: zsh Name: zsh
Version: 5.9 Version: 5.9
Release: 10%{?dist} Release: 11%{?dist}
License: MIT-Modern-Variant AND ISC AND GPL-2.0-only License: MIT-Modern-Variant AND ISC AND GPL-2.0-only
URL: http://zsh.sourceforge.net/ URL: http://zsh.sourceforge.net/
Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz
@ -25,6 +25,7 @@ Patch4: 0004-zsh-enable-PCRE-locale-switching.patch
Patch5: 0005-zsh-port-to-pcre2.patch Patch5: 0005-zsh-port-to-pcre2.patch
# upstream commit ecd3f9c9506c7720dc6c0833dc5d5eb00e4459c4 # upstream commit ecd3f9c9506c7720dc6c0833dc5d5eb00e4459c4
Patch6: 0006-zsh-support-texinfo-7.0.patch Patch6: 0006-zsh-support-texinfo-7.0.patch
Patch7: zsh-configure-c99.patch
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: coreutils BuildRequires: coreutils
@ -170,6 +171,9 @@ fi
%doc Doc/*.html %doc Doc/*.html
%changelog %changelog
* Fri Dec 8 2023 Florian Weimer <fweimer@redhat.com> - 5.9-11
- Fix C compatibility issue in the configure script
* Tue Nov 21 2023 Lukáš Zaoral <lzaoral@redhat.com> - 5.9-10 * Tue Nov 21 2023 Lukáš Zaoral <lzaoral@redhat.com> - 5.9-10
- fix FTBFS caused by texinfo 7.1 - fix FTBFS caused by texinfo 7.1
- fix build of the PCRE module - fix build of the PCRE module