Merge ~liushuyu-011/ubuntu/+source/zsh:ubuntu/devel into ubuntu/+source/zsh:ubuntu/devel

Proposed by Zixing Liu
Status: Merged
Merged at revision: 84f091a76b92c19ba7556782b13e4646f07826de
Proposed branch: ~liushuyu-011/ubuntu/+source/zsh:ubuntu/devel
Merge into: ubuntu/+source/zsh:ubuntu/devel
Diff against target: 599 lines (+571/-0)
4 files modified
debian/changelog (+9/-0)
debian/patches/cherry-pick-50641-use-int-main-in-test-C-codes-in-configure.patch (+541/-0)
debian/patches/fix-boolcodes-pointer-type.patch (+19/-0)
debian/patches/series (+2/-0)
Reviewer Review Type Date Requested Status
Vladimir Petko (community) Approve
Review via email: mp+473532@code.launchpad.net

Description of the change

This merge proposal fixes zsh FTBFS when building with GCC 14 due to mismatching pointer types.

To post a comment you must log in.
Revision history for this message
Zixing Liu (liushuyu-011) wrote :
Revision history for this message
Vladimir Petko (vpa1977) wrote :

- Please forward the patch upstream and update the patch header.
- Please add ftbfs bug and reference it in the changelog/patch
- Please run quilt refresh.
- PPA build failed due to some freeze. It also needs fixing investigating.

review: Needs Fixing
Revision history for this message
Zixing Liu (liushuyu-011) wrote :

This is now fixed

Revision history for this message
Vladimir Petko (vpa1977) wrote :

Would it be possible to raise a bug on LP and update the patch headers to include Origin: and Bug-Ubuntu?

Revision history for this message
Zixing Liu (liushuyu-011) wrote :

Done.

Revision history for this message
Vladimir Petko (vpa1977) wrote :

Made minor changes:
 - reformatted changelog
 - added reference to Ubuntu bug in debian/patches/fix-boolcodes-pointer-type.patch
 - ran quilt refresh on patches.

Uploaded, thank you!!!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 8f7b137..c37f38f 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,12 @@
6+zsh (5.9-6ubuntu3) oracular; urgency=medium
7+
8+ * d/p/fix-boolcodes-pointer-type.patch: add a patch to fix the pointer type
9+ of boolcodes to fix build with GCC 14.
10+ * d/p/cherry-pick-50641-use-int-main-in-test-C-codes-in-configure.patch: add
11+ an upstream patch to fix broken detections with GCC 14 (LP: #2081998).
12+
13+ -- Zixing Liu <zixing.liu@canonical.com> Thu, 19 Sep 2024 11:14:09 -0600
14+
15 zsh (5.9-6ubuntu2) noble; urgency=high
16
17 * No change rebuild for 64-bit time_t and frame pointers.
18diff --git a/debian/patches/cherry-pick-50641-use-int-main-in-test-C-codes-in-configure.patch b/debian/patches/cherry-pick-50641-use-int-main-in-test-C-codes-in-configure.patch
19new file mode 100644
20index 0000000..629b69f
21--- /dev/null
22+++ b/debian/patches/cherry-pick-50641-use-int-main-in-test-C-codes-in-configure.patch
23@@ -0,0 +1,541 @@
24+Description: 50641: use 'int main()' in test C-codes in configure
25+Author: Nicholas Vinson <nvinson234@gmail.com>
26+Origin: upstream, https://sourceforge.net/p/zsh/code/ci/ab4d62eb975a4c4c51dd35822665050e2ddc6918
27+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/zsh/+bug/2081998
28+Last-Update: 2024-09-25
29+---
30+Index: zsh/aczsh.m4
31+===================================================================
32+--- zsh.orig/aczsh.m4
33++++ zsh/aczsh.m4
34+@@ -44,6 +44,7 @@ AC_DEFUN(zsh_64_BIT_TYPE,
35+ #include <sys/types.h>
36+ #endif
37+
38++int
39+ main()
40+ {
41+ $1 foo = 0;
42+@@ -118,7 +119,6 @@ AC_TRY_COMMAND($DLLD -o conftest1.$DL_EX
43+ AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&AS_MESSAGE_LOG_FD) &&
44+ AC_TRY_COMMAND($DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&AS_MESSAGE_LOG_FD); then
45+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
46+-#include <stdlib.h>
47+ #ifdef HPUX10DYNAMIC
48+ #include <dl.h>
49+ #define RTLD_LAZY BIND_DEFERRED
50+@@ -146,29 +146,30 @@ char *zsh_gl_sym_addr ;
51+ #define RTLD_GLOBAL 0
52+ #endif
53+
54++int
55+ main()
56+ {
57+ void *handle1, *handle2;
58+ void *(*zsh_getaddr1)(), *(*zsh_getaddr2)();
59+ void *sym1, *sym2;
60+ handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
61+- if(!handle1) exit(1);
62++ if(!handle1) return(1);
63+ handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
64+- if(!handle2) exit(1);
65++ if(!handle2) return(1);
66+ zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1");
67+ zsh_getaddr2 = (void *(*)()) dlsym(handle2, "${us}zsh_getaddr2");
68+ sym1 = zsh_getaddr1();
69+ sym2 = zsh_getaddr2();
70+- if(!sym1 || !sym2) exit(1);
71+- if(sym1 != sym2) exit(1);
72++ if(!sym1 || !sym2) return(1);
73++ if(sym1 != sym2) return(1);
74+ dlclose(handle1);
75+ handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
76+- if(!handle1) exit(1);
77++ if(!handle1) return(1);
78+ zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1");
79+ sym1 = zsh_getaddr1();
80+- if(!sym1) exit(1);
81+- if(sym1 != sym2) exit(1);
82+- exit(0);
83++ if(!sym1) return(1);
84++ if(sym1 != sym2) return(1);
85++ return(0);
86+ }
87+ ]])],[zsh_cv_shared_$1=yes],
88+ [zsh_cv_shared_$1=no],
89+@@ -200,7 +201,6 @@ AC_TRY_COMMAND($DLLD -o conftest1.$DL_EX
90+ AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&AS_MESSAGE_LOG_FD) &&
91+ AC_TRY_COMMAND($DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&AS_MESSAGE_LOG_FD); then
92+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
93+-#include <stdlib.h>
94+ #ifdef HPUX10DYNAMIC
95+ #include <dl.h>
96+ #define RTLD_LAZY BIND_DEFERRED
97+@@ -228,19 +228,19 @@ char *zsh_gl_sym_addr ;
98+ #define RTLD_GLOBAL 0
99+ #endif
100+
101+-
102++int
103+ main()
104+ {
105+ void *handle1, *handle2;
106+ int (*fred1)(), (*fred2)();
107+ handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
108+- if(!handle1) exit(1);
109++ if(!handle1) return(1);
110+ handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
111+- if(!handle2) exit(1);
112++ if(!handle2) return(1);
113+ fred1 = (int (*)()) dlsym(handle1, "${us}fred");
114+ fred2 = (int (*)()) dlsym(handle2, "${us}fred");
115+- if(!fred1 || !fred2) exit(1);
116+- exit((*fred1)() != 42 || (*fred2)() != 69);
117++ if(!fred1 || !fred2) return(1);
118++ return((*fred1)() != 42 || (*fred2)() != 69);
119+ }
120+ ]])],[zsh_cv_sys_dynamic_clash_ok=yes],
121+ [zsh_cv_sys_dynamic_clash_ok=no],
122+@@ -276,7 +276,6 @@ AC_TRY_COMMAND($DLLD -o conftest1.$DL_EX
123+ AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&AS_MESSAGE_LOG_FD) &&
124+ AC_TRY_COMMAND($DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&AS_MESSAGE_LOG_FD); then
125+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
126+-#include <stdlib.h>
127+ #ifdef HPUX10DYNAMIC
128+ #include <dl.h>
129+ #define RTLD_LAZY BIND_DEFERRED
130+@@ -304,17 +303,18 @@ char *zsh_gl_sym_addr ;
131+ #define RTLD_GLOBAL 0
132+ #endif
133+
134++int
135+ main()
136+ {
137+ void *handle;
138+ int (*barneysym)();
139+ handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
140+- if(!handle) exit(1);
141++ if(!handle) return(1);
142+ handle = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
143+- if(!handle) exit(1);
144++ if(!handle) return(1);
145+ barneysym = (int (*)()) dlsym(handle, "${us}barney");
146+- if(!barneysym) exit(1);
147+- exit((*barneysym)() != 69);
148++ if(!barneysym) return(1);
149++ return((*barneysym)() != 69);
150+ }
151+ ]])],[zsh_cv_sys_dynamic_rtld_global=yes],
152+ [zsh_cv_sys_dynamic_rtld_global=no],
153+@@ -346,7 +346,6 @@ AC_TRY_COMMAND($DLLD -o conftest1.$DL_EX
154+ save_ldflags=$LDFLAGS
155+ LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
156+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
157+-#include <stdlib.h>
158+ #ifdef HPUX10DYNAMIC
159+ #include <dl.h>
160+ #define RTLD_LAZY BIND_DEFERRED
161+@@ -374,15 +373,16 @@ char *zsh_gl_sym_addr ;
162+ #define RTLD_GLOBAL 0
163+ #endif
164+
165++int
166+ main()
167+ {
168+ void *handle;
169+ int (*barneysym)();
170+ handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
171+- if(!handle) exit(1);
172++ if(!handle) return(1);
173+ barneysym = (int (*)()) dlsym(handle, "${us}barney");
174+- if(!barneysym) exit(1);
175+- exit((*barneysym)() != 69);
176++ if(!barneysym) return(1);
177++ return((*barneysym)() != 69);
178+ }
179+
180+ int fred () { return 42; }
181+@@ -420,7 +420,6 @@ elif
182+ save_ldflags=$LDFLAGS
183+ LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS -s"
184+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
185+-#include <stdlib.h>
186+ #ifdef HPUX10DYNAMIC
187+ #include <dl.h>
188+ #define RTLD_LAZY BIND_DEFERRED
189+@@ -448,15 +447,16 @@ char *zsh_gl_sym_addr ;
190+ #define RTLD_GLOBAL 0
191+ #endif
192+
193++int
194+ main()
195+ {
196+ void *handle;
197+ int (*barneysym)();
198+ handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
199+- if(!handle) exit(1);
200++ if(!handle) return(1);
201+ barneysym = (int (*)()) dlsym(handle, "${us}barney");
202+- if(!barneysym) exit(1);
203+- exit((*barneysym)() != 69);
204++ if(!barneysym) return(1);
205++ return((*barneysym)() != 69);
206+ }
207+
208+ int fred () { return 42; }
209+@@ -488,7 +488,6 @@ echo 'int fred () { return 42; }' > conf
210+ if AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&AS_MESSAGE_LOG_FD) &&
211+ AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS -s conftest1.o $LIBS 1>&AS_MESSAGE_LOG_FD); then
212+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
213+-#include <stdlib.h>
214+ #ifdef HPUX10DYNAMIC
215+ #include <dl.h>
216+ #define RTLD_LAZY BIND_DEFERRED
217+@@ -516,15 +515,16 @@ char *zsh_gl_sym_addr ;
218+ #define RTLD_GLOBAL 0
219+ #endif
220+
221++int
222+ main()
223+ {
224+ void *handle;
225+ int (*fredsym)();
226+ handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
227+- if(!handle) exit(1);
228++ if(!handle) return(1);
229+ fredsym = (int (*)()) dlsym(handle, "${us}fred");
230+- if(!fredsym) exit(1);
231+- exit((*fredsym)() != 42);
232++ if(!fredsym) return(1);
233++ return((*fredsym)() != 42);
234+ }
235+ ]])],[zsh_cv_sys_dynamic_strip_lib=yes],
236+ [zsh_cv_sys_dynamic_strip_lib=no],
237+Index: zsh/configure.ac
238+===================================================================
239+--- zsh.orig/configure.ac
240++++ zsh/configure.ac
241+@@ -596,7 +596,7 @@ fi
242+ dnl Checking if compiler correctly cast signed to unsigned.
243+ AC_CACHE_CHECK(if signed to unsigned casting is broken,
244+ zsh_cv_c_broken_signed_to_unsigned_casting,
245+-[AC_RUN_IFELSE([AC_LANG_SOURCE([[main(){return((int)(unsigned char)((char) -1) == 255);}]])],[zsh_cv_c_broken_signed_to_unsigned_casting=yes],[zsh_cv_c_broken_signed_to_unsigned_casting=no],[zsh_cv_c_broken_signed_to_unsigned_casting=no])])
246++[AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(){return((int)(unsigned char)((char) -1) == 255);}]])],[zsh_cv_c_broken_signed_to_unsigned_casting=yes],[zsh_cv_c_broken_signed_to_unsigned_casting=no],[zsh_cv_c_broken_signed_to_unsigned_casting=no])])
247+ AH_TEMPLATE([BROKEN_SIGNED_TO_UNSIGNED_CASTING],
248+ [Define to 1 if compiler incorrectly cast signed to unsigned.])
249+ if test x$zsh_cv_c_broken_signed_to_unsigned_casting = xyes; then
250+@@ -1052,7 +1052,7 @@ else
251+ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
252+ #include <sys/types.h>
253+
254+-main() { return sizeof(off_t) < 8; }
255++int main() { return sizeof(off_t) < 8; }
256+ ]])],[zsh_cv_off_t_is_64_bit=yes],[zsh_cv_off_t_is_64_bit=no],[zsh_cv_off_t_is_64_bit=no])])
257+ if test x$zsh_cv_off_t_is_64_bit = xyes; then
258+ AC_DEFINE(OFF_T_IS_64_BIT)
259+@@ -1062,7 +1062,7 @@ main() { return sizeof(off_t) < 8; }
260+ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
261+ #include <sys/types.h>
262+
263+-main() { return sizeof(ino_t) < 8; }
264++int main() { return sizeof(ino_t) < 8; }
265+ ]])],[zsh_cv_ino_t_is_64_bit=yes],[zsh_cv_ino_t_is_64_bit=no],[zsh_cv_ino_t_is_64_bit=no])])
266+ if test x$zsh_cv_ino_t_is_64_bit = xyes; then
267+ AC_DEFINE(INO_T_IS_64_BIT)
268+@@ -1374,7 +1374,7 @@ zsh_cv_func_realpath_accepts_null,
269+ #include <stdlib.h>
270+ #include <limits.h>
271+ ],[
272+-exit(!realpath("/", (char*)0));
273++return(!realpath("/", (char*)0));
274+ ])],
275+ [zsh_cv_func_realpath_accepts_null=yes],
276+ [zsh_cv_func_realpath_accepts_null=no],
277+@@ -1403,10 +1403,9 @@ AC_CACHE_CHECK(if tgetent accepts NULL,
278+ zsh_cv_func_tgetent_accepts_null,
279+ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
280+ #include <fcntl.h>
281+-#include <stdlib.h>
282+ int tgetent(char *, char *);
283+ char *tgetstr(char *, char **);
284+-main()
285++int main()
286+ {
287+ char buf[4096];
288+ int r1 = tgetent(buf, "vt100");
289+@@ -1417,7 +1416,7 @@ main()
290+ tgetstr("cl", &u);
291+ creat("conftest.tgetent", 0640);
292+ }
293+- exit((r1 != r2) || r2 == -1);
294++ return((r1 != r2) || r2 == -1);
295+ }
296+ ]])],[if test -f conftest.tgetent; then
297+ zsh_cv_func_tgetent_accepts_null=yes
298+@@ -1431,10 +1430,9 @@ AC_CACHE_CHECK(if tgetent returns 0 on s
299+ zsh_cv_func_tgetent_zero_success,
300+ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
301+ #include <fcntl.h>
302+-#include <stdlib.h>
303+ int tgetent(char *, char*);
304+ char *tgetstr(char *, char **);
305+-main()
306++int main()
307+ {
308+ char buf[4096];
309+ int r1 = tgetent(buf, "!@#$%^&*");
310+@@ -1445,7 +1443,7 @@ main()
311+ tgetstr("cl", &u);
312+ creat("conftest.tgetent0", 0640);
313+ }
314+- exit(r1 == r2);
315++ return(r1 == r2);
316+ }
317+ ]])],[if test -f conftest.tgetent0; then
318+ zsh_cv_func_tgetent_zero_success=yes
319+@@ -1871,8 +1869,7 @@ zsh_cv_rlim_t_is_longer,
320+ #include <sys/time.h>
321+ #endif
322+ #include <sys/resource.h>
323+-#include <stdlib.h>
324+-main(){struct rlimit r;exit(sizeof(r.rlim_cur) <= sizeof(long));}]])],[zsh_cv_rlim_t_is_longer=yes],[zsh_cv_rlim_t_is_longer=no],[zsh_cv_rlim_t_is_longer=yes])])
325++int main(){struct rlimit r;return(sizeof(r.rlim_cur) <= sizeof(long));}]])],[zsh_cv_rlim_t_is_longer=yes],[zsh_cv_rlim_t_is_longer=no],[zsh_cv_rlim_t_is_longer=yes])])
326+ if test x$zsh_cv_rlim_t_is_longer = xyes; then
327+ AC_CACHE_CHECK(if rlim_t is a quad,
328+ zsh_cv_rlim_t_is_quad_t,
329+@@ -1882,13 +1879,12 @@ if test x$zsh_cv_rlim_t_is_longer = xyes
330+ #endif
331+ #include <stdio.h>
332+ #include <sys/resource.h>
333+-#include <stdlib.h>
334+-main() {
335++int main() {
336+ struct rlimit r;
337+ char buf[20];
338+ r.rlim_cur = 0;
339+ sprintf(buf, "%qd", r.rlim_cur);
340+- exit(strcmp(buf, "0"));
341++ return(strcmp(buf, "0"));
342+ }]])],[zsh_cv_rlim_t_is_quad_t=yes],[zsh_cv_rlim_t_is_quad_t=no],[zsh_cv_rlim_t_is_quad_t=no])])
343+ if test x$zsh_cv_rlim_t_is_quad_t = xyes; then
344+ AC_DEFINE(RLIM_T_IS_QUAD_T)
345+@@ -1905,8 +1901,7 @@ else
346+ #include <sys/time.h>
347+ #endif
348+ #include <sys/resource.h>
349+-#include <stdlib.h>
350+- main(){struct rlimit r;r.rlim_cur=-1;exit(r.rlim_cur<0);}]])],[zsh_cv_type_rlim_t_is_unsigned=yes],[zsh_cv_type_rlim_t_is_unsigned=no],[zsh_cv_type_rlim_t_is_unsigned=no])])
351++ int main(){struct rlimit r;r.rlim_cur=-1;return(r.rlim_cur<0);}]])],[zsh_cv_type_rlim_t_is_unsigned=yes],[zsh_cv_type_rlim_t_is_unsigned=no],[zsh_cv_type_rlim_t_is_unsigned=no])])
352+ if test x$zsh_cv_type_rlim_t_is_unsigned = xyes; then
353+ AC_DEFINE(RLIM_T_IS_UNSIGNED)
354+ DEFAULT_RLIM_T="unsigned $DEFAULT_RLIM_T"
355+@@ -2185,9 +2180,8 @@ zsh_cv_sys_fifo,
356+ #include <fcntl.h>
357+ #include <signal.h>
358+ #include <unistd.h>
359+-#include <stdlib.h>
360+ #include <sys/stat.h>
361+-main()
362++int main()
363+ {
364+ char c;
365+ int fd;
366+@@ -2198,18 +2192,18 @@ main()
367+ #else
368+ if(mknod("/tmp/fifo$$", 0010600, 0) < 0)
369+ #endif
370+- exit(1);
371++ return(1);
372+ pid = fork();
373+ if(pid < 0)
374+- exit(1);
375++ return(1);
376+ if(pid) {
377+ fd = open("/tmp/fifo$$", O_RDONLY);
378+- exit(fd < 0 || read(fd, &c, 1) != 1 || c != 'x');
379++ return(fd < 0 || read(fd, &c, 1) != 1 || c != 'x');
380+ }
381+ fd = open("/tmp/fifo$$", O_WRONLY);
382+ ret = (fd < 0 || write(fd, "x", 1) < 1);
383+ unlink("/tmp/fifo$$");
384+- exit(ret);
385++ return(ret);
386+ }
387+ ]])],[zsh_cv_sys_fifo=yes],[zsh_cv_sys_fifo=no],[zsh_cv_sys_fifo=yes])
388+ ])
389+@@ -2287,8 +2281,7 @@ zsh_cv_sys_link,
390+ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
391+ #include <unistd.h>
392+ #include <fcntl.h>
393+-#include <stdlib.h>
394+-main()
395++int main()
396+ {
397+ int ret;
398+ char *tmpfile, *newfile;
399+@@ -2297,11 +2290,11 @@ main()
400+ unlink(tmpfile);
401+ unlink(newfile);
402+ if(creat(tmpfile, 0644) < 0)
403+- exit(1);
404++ return(1);
405+ ret = link(tmpfile, newfile);
406+ unlink(tmpfile);
407+ unlink(newfile);
408+- exit(ret<0);
409++ return(ret<0);
410+ }
411+ ]])],[zsh_cv_sys_link=yes],[zsh_cv_sys_link=no],[zsh_cv_sys_link=yes])])
412+ AH_TEMPLATE([HAVE_LINK],
413+@@ -2320,12 +2313,11 @@ zsh_cv_sys_killesrch,
414+ #include <unistd.h>
415+ #include <signal.h>
416+ #include <errno.h>
417+-#include <stdlib.h>
418+-main()
419++int main()
420+ {
421+ int pid = (getpid() + 10000) & 0xffffff;
422+ while (pid && (kill(pid, 0) == 0 || errno != ESRCH)) pid >>= 1;
423+- exit(errno!=ESRCH);
424++ return(errno!=ESRCH);
425+ }
426+ ]])],[zsh_cv_sys_killesrch=yes],[zsh_cv_sys_killesrch=no],[zsh_cv_sys_killesrch=yes])])
427+ AH_TEMPLATE([BROKEN_KILL_ESRCH],
428+@@ -2346,12 +2338,11 @@ if test x$signals_style = xPOSIX_SIGNALS
429+ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
430+ #include <signal.h>
431+ #include <unistd.h>
432+-#include <stdlib.h>
433+ int child=0;
434+ void handler(sig)
435+ int sig;
436+ {if(sig==SIGCHLD) child=1;}
437+-main() {
438++int main() {
439+ struct sigaction act;
440+ sigset_t set;
441+ int pid, ret;
442+@@ -2366,7 +2357,7 @@ main() {
443+ if(pid>0) {
444+ sigemptyset(&set);
445+ ret=sigsuspend(&set);
446+- exit(child==0);
447++ return(child==0);
448+ }
449+ }
450+ ]])],[zsh_cv_sys_sigsuspend=yes],[zsh_cv_sys_sigsuspend=no],[zsh_cv_sys_sigsuspend=yes])])
451+@@ -2398,15 +2389,14 @@ case "x$zsh_working_tcsetpgrp" in
452+ #include <sys/types.h>
453+ #include <unistd.h>
454+ #include <fcntl.h>
455+-#include <stdlib.h>
456+-main() {
457++int main() {
458+ int fd;
459+ int ret;
460+ fd=open("/dev/tty", O_RDWR);
461+- if (fd < 0) exit(2);
462++ if (fd < 0) return(2);
463+ ret=tcsetpgrp(fd, tcgetpgrp(fd));
464+- if (ret < 0) exit(1);
465+- exit(0);
466++ if (ret < 0) return(1);
467++ return(0);
468+ }
469+ ]])],[zsh_cv_sys_tcsetpgrp=yes],[
470+ case $? in
471+@@ -2446,7 +2436,7 @@ if test x$ac_cv_func_getpwnam = xyes; th
472+ #include <string.h>
473+ #include <stdlib.h>
474+ #include <unistd.h>
475+-main() {
476++int main() {
477+ struct passwd *pw1, *pw2;
478+ char buf[1024], name[1024];
479+ sprintf(buf, "%d:%d", getpid(), rand());
480+@@ -2454,7 +2444,7 @@ main() {
481+ if (pw1) strcpy(name, pw1->pw_name);
482+ sprintf(buf, "%d:%d", rand(), getpid());
483+ pw2=getpwnam(buf);
484+- exit(pw1!=0 && pw2!=0 && !strcmp(name, pw2->pw_name));
485++ return(pw1!=0 && pw2!=0 && !strcmp(name, pw2->pw_name));
486+ }
487+ ]])],[zsh_cv_sys_getpwnam_faked=no],[zsh_cv_sys_getpwnam_faked=yes],[zsh_cv_sys_getpwnam_faked=no])])
488+ if test x$zsh_cv_sys_getpwnam_faked = xyes; then
489+@@ -2773,20 +2763,17 @@ elif test "x$dynamic" = xyes; then
490+ zsh_cv_sys_elf,
491+ [AC_RUN_IFELSE([AC_LANG_SOURCE([[/* Test for whether ELF binaries are produced */
492+ #include <fcntl.h>
493+-#include <stdlib.h>
494+ #include <unistd.h>
495+-main(argc, argv)
496+-int argc;
497+-char *argv[];
498++int main(int argc, char *argv[])
499+ {
500+ char b[4];
501+ int i = open(argv[0],O_RDONLY);
502+ if(i == -1)
503+- exit(1); /* fail */
504++ return(1); /* fail */
505+ if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
506+- exit(0); /* succeed (yes, it's ELF) */
507++ return(0); /* succeed (yes, it's ELF) */
508+ else
509+- exit(1); /* fail */
510++ return(1); /* fail */
511+ }]])],[zsh_cv_sys_elf=yes],[zsh_cv_sys_elf=no],[zsh_cv_sys_elf=yes])])
512+
513+ # We use [0-9]* in case statements, so need to change quoting
514+@@ -2922,13 +2909,12 @@ LDFLAGS="$old_LDFLAGS")
515+ AC_CACHE_CHECK(if your dlsym() needs a leading underscore,
516+ zsh_cv_func_dlsym_needs_underscore,
517+ [echo failed >conftestval && cat >conftest.c <<EOM
518+-fred () { }
519++void fred () { }
520+ EOM
521+ AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest.c 1>&AS_MESSAGE_LOG_FD) &&
522+ AC_TRY_COMMAND($DLLD $LDFLAGS $DLLDFLAGS -o conftest.$DL_EXT conftest.o 1>&AS_MESSAGE_LOG_FD) &&
523+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
524+ #include <stdio.h>
525+-#include <stdlib.h>
526+ #ifdef HPUX10DYNAMIC
527+ #include <dl.h>
528+ #define RTLD_LAZY BIND_DEFERRED
529+@@ -2955,16 +2941,16 @@ char *zsh_gl_sym_addr ;
530+
531+ extern int fred() ;
532+
533+-main()
534++int main()
535+ {
536+ void * handle ;
537+ void * symbol ;
538+ FILE *f=fopen("conftestval", "w");
539+- if (!f) exit(1);
540++ if (!f) return(1);
541+ handle = dlopen("./conftest.$DL_EXT", RTLD_LAZY) ;
542+ if (handle == NULL) {
543+ fprintf (f, "dlopen failed") ;
544+- exit(1);
545++ return(1);
546+ }
547+ symbol = dlsym(handle, "fred") ;
548+ if (symbol == NULL) {
549+@@ -2972,13 +2958,13 @@ main()
550+ symbol = dlsym(handle, "_fred") ;
551+ if (symbol == NULL) {
552+ fprintf (f, "dlsym failed") ;
553+- exit(1);
554++ return(1);
555+ }
556+ fprintf (f, "yes") ;
557+ }
558+ else
559+ fprintf (f, "no") ;
560+- exit(0);
561++ return(0);
562+ }]])],[zsh_cv_func_dlsym_needs_underscore=`cat conftestval`],[zsh_cv_func_dlsym_needs_underscore=failed
563+ dynamic=no],[zsh_cv_func_dlsym_needs_underscore=no])])
564+ if test "x$zsh_cv_func_dlsym_needs_underscore" = xyes; then
565diff --git a/debian/patches/fix-boolcodes-pointer-type.patch b/debian/patches/fix-boolcodes-pointer-type.patch
566new file mode 100644
567index 0000000..474dea5
568--- /dev/null
569+++ b/debian/patches/fix-boolcodes-pointer-type.patch
570@@ -0,0 +1,19 @@
571+Description: Fix FTBFS with GCC 14
572+ Due to mismatching pointer types
573+Author: Zixing Liu <zixing.liu@canonical.com>
574+Forwarded: https://zsh.org/workers/53125
575+Last-Update: 2024-09-19
576+---
577+Index: zsh/Src/Modules/termcap.c
578+===================================================================
579+--- zsh.orig/Src/Modules/termcap.c
580++++ zsh/Src/Modules/termcap.c
581+@@ -42,7 +42,7 @@
582+ #ifdef HAVE_TGETENT
583+
584+ #ifndef HAVE_BOOLCODES
585+-static char *boolcodes[] = {
586++NCURSES_CONST char *const boolcodes[] = {
587+ "bw", "am", "ut", "cc", "xs", "YA", "YF", "YB", "xt", "xn", "eo",
588+ "gn", "hc", "HC", "km", "YC", "hs", "hl", "in", "YG", "da", "db",
589+ "mi", "ms", "nx", "xb", "NP", "ND", "NR", "os", "5i", "YD", "YE",
590diff --git a/debian/patches/series b/debian/patches/series
591index b8914f5..0481963 100644
592--- a/debian/patches/series
593+++ b/debian/patches/series
594@@ -10,3 +10,5 @@ cherry-pick-4b7a9fd0-additional-typset--p--m-fix-for-namespaces.patch
595 cherry-pick-b62e91134-51723-migrate-pcre-module-to-pcre2.patch
596 cherry-pick-10bdbd8b-51877-do-not-build-pcre-module-if-pcre2-config-is-not-found.patch
597 cherry-pick-ecd3f9c9-1057610-support-texinfo-7.0.patch
598+fix-boolcodes-pointer-type.patch
599+cherry-pick-50641-use-int-main-in-test-C-codes-in-configure.patch

Subscribers

People subscribed via source and target branches