zsh: fix compilation with GCC14
authorRosen Penev <redacted>
Sat, 8 Jun 2024 23:38:04 +0000 (16:38 -0700)
committerRosen Penev <redacted>
Sun, 9 Jun 2024 00:31:38 +0000 (17:31 -0700)
Upstream backport and local patch.

Signed-off-by: Rosen Penev <redacted>
utils/zsh/Makefile
utils/zsh/patches/006-52383-Avoid-incompatible-pointer-types-in-terminfo-g.patch [new file with mode: 0644]
utils/zsh/patches/010-gcc14.patch [new file with mode: 0644]

index b97491bae378e619f7ecc344f643d4356ef19230..eedf6364a68a59cef2223a3f3ab16a12e4de3912 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zsh
 PKG_VERSION:=5.9
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@SF/zsh
diff --git a/utils/zsh/patches/006-52383-Avoid-incompatible-pointer-types-in-terminfo-g.patch b/utils/zsh/patches/006-52383-Avoid-incompatible-pointer-types-in-terminfo-g.patch
new file mode 100644 (file)
index 0000000..5dc1461
--- /dev/null
@@ -0,0 +1,46 @@
+From 4c89849c98172c951a9def3690e8647dae76308f Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Fri, 8 Dec 2023 21:58:07 +0100
+Subject: [PATCH] 52383: Avoid incompatible pointer types in terminfo global
+ variable checks
+
+---
+ configure.ac | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -1766,27 +1766,27 @@ if test x$zsh_cv_path_term_header != xno
+   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
diff --git a/utils/zsh/patches/010-gcc14.patch b/utils/zsh/patches/010-gcc14.patch
new file mode 100644 (file)
index 0000000..4fe4a8a
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/Src/Modules/pcre.c
++++ b/Src/Modules/pcre.c
+@@ -152,7 +152,7 @@ zpcre_get_substrings(pcre2_code *pat, ch
+       int nelem = captured_count - 1;
+       /* Set to the offsets of the complete match */
+       if (want_offset_pair) {
+-          sprintf(offset_all, "%ld %ld", ovec[0], ovec[1]);
++          sprintf(offset_all, "%zd %zd", ovec[0], ovec[1]);
+           setsparam("ZPCRE_OP", ztrdup(offset_all));
+       }
+       /*
git clone https://git.99rst.org/PROJECT