1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-12 18:59:50 +03:00

main/expect: fix build with gcc 15

This commit is contained in:
Celeste 2025-06-24 17:57:08 +00:00
parent d148cf7bc9
commit 51c18b555b
2 changed files with 152 additions and 0 deletions

View file

@ -20,6 +20,7 @@ source="https://downloads.sourceforge.net/project/expect/Expect/$pkgver/expect$p
expect-5.45.4-covscan-fixes.patch
expect-c99.patch
expect-configure-c99.patch
gcc15.patch
"
builddir="$srcdir"/$pkgname$pkgver
@ -62,4 +63,5 @@ f4c7789feea3eae471c988d7c78ce78da1bd4ab765d142e7fce5a7a2a92e887310ba571ea2a01011
0610e7e901857b773be7d5b01cae6a1844914b7f9ff1a7c5f02dc89e14dd6318711a2417f97a10fb28866fed77e16c7757ca6c6ca65e5603defddb551e9a14a3 expect-5.45.4-covscan-fixes.patch
dc0078b3ccd7aacfd86e24249b0570b3c0cdbf1c0b660a1414df0b28d32503995e7fca3b582d08dc94a4855ef3cc280f2fc9233c331f07e30c23ff6e8a9f1b27 expect-c99.patch
5e48866ffa0891f7c28edf871d563d67e7b720743feea1a199766b76b54316b97be4121a05c4de205b00eaa4efea8659349699d78fe12cb9777c89a36f2d6b78 expect-configure-c99.patch
d7c797fe7f93e62a886701e705185f2941bf58acc3c3400ee9a54b6a5e945e4f619611624d61346ff7eafb5d294e5e04dc8bd81e0541c38c65095100ed34f430 gcc15.patch
"

150
main/expect/gcc15.patch Normal file
View file

@ -0,0 +1,150 @@
diff --git a/exp_clib.c b/exp_clib.c
index 0a12f0a..9f1759c 100644
--- a/exp_clib.c
+++ b/exp_clib.c
@@ -131,6 +131,7 @@ extern unsigned long strtoul _ANSI_ARGS_((CONST char *string,
extern char *Tcl_ErrnoMsg(int err);
extern char *Tcl_Alloc(unsigned int size);
extern void Tcl_Free(char *ptr);
+#include <tcl.h>
#include "expect.h"
#include "exp_command.h"
#define TclRegError exp_TclRegError
@@ -1744,9 +1745,9 @@ int exp_logfile_all = FALSE; /* if TRUE, write log of all interactions */
int exp_loguser = TRUE; /* if TRUE, user sees interactions on stdout */
-char *exp_printify();
+char *exp_printify(char *);
int exp_getptymaster();
-int exp_getptyslave();
+int exp_getptyslave(int, int, CONST char *);
#define sysreturn(x) return(errno = x, -1)
diff --git a/exp_command.h b/exp_command.h
index d30d911..79d2bd7 100644
--- a/exp_command.h
+++ b/exp_command.h
@@ -222,8 +222,8 @@ EXTERN int exp_trap_off _ANSI_ARGS_((char *));
EXTERN void exp_strftime(char *format, const struct tm *timeptr,Tcl_DString *dstring);
-#define exp_deleteProc (void (*)())0
-#define exp_deleteObjProc (void (*)())0
+#define exp_deleteProc (void (*)(void *))0
+#define exp_deleteObjProc (void (*)(void *))0
EXTERN int expect_key;
EXTERN int exp_configure_count; /* # of times descriptors have been closed */
@@ -321,7 +321,7 @@ EXTERN void exp_init_expect_cmds _ANSI_ARGS_((Tcl_Interp *));
EXTERN void exp_init_most_cmds _ANSI_ARGS_((Tcl_Interp *));
EXTERN void exp_init_trap_cmds _ANSI_ARGS_((Tcl_Interp *));
EXTERN void exp_init_interact_cmds _ANSI_ARGS_((Tcl_Interp *));
-EXTERN void exp_init_tty_cmds();
+EXTERN void exp_init_tty_cmds _ANSI_ARGS_((Tcl_Interp *));
EXTERN ExpState * expStateCheck _ANSI_ARGS_((Tcl_Interp *,ExpState *,int,int,char *));
EXTERN ExpState * expStateCurrent _ANSI_ARGS_((Tcl_Interp *,int,int,int));
diff --git a/exp_main_sub.c b/exp_main_sub.c
index 499c0ae..0be855b 100644
--- a/exp_main_sub.c
+++ b/exp_main_sub.c
@@ -49,8 +49,8 @@ char exp_version[] = PACKAGE_VERSION;
#define NEED_TCL_MINOR 5
char *exp_argv0 = "this program"; /* default program name */
-void (*exp_app_exit)() = 0;
-void (*exp_event_exit)() = 0;
+void (*exp_app_exit)(Tcl_Interp *) = 0;
+void (*exp_event_exit)(Tcl_Interp *) = 0;
FILE *exp_cmdfile = 0;
char *exp_cmdfilename = 0;
int exp_cmdlinecmds = FALSE;
@@ -921,7 +921,7 @@ int sys_rc;
char file[200];
char *home;
int fd;
- char *getenv();
+ char *getenv(const char *);
if ((NULL != (home = getenv("DOTDIR"))) ||
(NULL != (home = getenv("HOME")))) {
diff --git a/exp_pty.c b/exp_pty.c
index 0970211..2d75512 100644
--- a/exp_pty.c
+++ b/exp_pty.c
@@ -134,8 +134,8 @@ int timeout;
return(cc);
}
-static RETSIGTYPE (*oldAlarmHandler)();
-static RETSIGTYPE (*oldHupHandler)();
+static RETSIGTYPE (*oldAlarmHandler)(int);
+static RETSIGTYPE (*oldHupHandler)(int);
static time_t current_time; /* time when testing began */
/* if TRUE, begin testing, else end testing */
diff --git a/exp_trap.c b/exp_trap.c
index 5233fe8..21a6aba 100644
--- a/exp_trap.c
+++ b/exp_trap.c
@@ -53,7 +53,7 @@ static struct trap {
int sigchld_count = 0; /* # of sigchlds caught but not yet processed */
-static int eval_trap_action();
+static int eval_trap_action(Tcl_Interp *, int, struct trap *, int);
static int got_sig; /* this records the last signal received */
/* it is only a hint and can be wiped out */
diff --git a/exp_tty.c b/exp_tty.c
index 690a65b..1df956b 100644
--- a/exp_tty.c
+++ b/exp_tty.c
@@ -572,7 +572,7 @@ Exp_SystemCmd(
char **argv)
{
int result = TCL_OK;
- RETSIGTYPE (*old)(); /* save old sigalarm handler */
+ RETSIGTYPE (*old)(int); /* save old sigalarm handler */
#define MAX_ARGLIST 10240
int i;
diff --git a/exp_win.h b/exp_win.h
index bd8c9be..1f49dce 100644
--- a/exp_win.h
+++ b/exp_win.h
@@ -8,8 +8,8 @@ would appreciate credit if you use this file or parts of it.
#include <tcl.h> /* For _ANSI_ARGS_ */
-int exp_window_size_set();
-int exp_window_size_get();
+int exp_window_size_set(int);
+int exp_window_size_get(int);
void exp_win_rows_set _ANSI_ARGS_ ((const char* rows));
char* exp_win_rows_get _ANSI_ARGS_ ((void));
diff --git a/pty_termios.c b/pty_termios.c
index a81110c..3375407 100644
--- a/pty_termios.c
+++ b/pty_termios.c
@@ -214,7 +214,7 @@ char *name; /* name of pty */
{
#define MAX_ARGLIST 10240
char buf[MAX_ARGLIST]; /* overkill is easier */
- RETSIGTYPE (*old)(); /* save old sigalarm handler */
+ RETSIGTYPE (*old)(int); /* save old sigalarm handler */
int pid;
old = signal(SIGCHLD, SIG_DFL);
@@ -274,7 +274,7 @@ char *name; /* name of pty */
{
#define MAX_ARGLIST 10240
char buf[MAX_ARGLIST]; /* overkill is easier */
- RETSIGTYPE (*old)(); /* save old sigalarm handler */
+ RETSIGTYPE (*old)(int); /* save old sigalarm handler */
#ifdef STTY_READS_STDOUT
sprintf(buf,"%s %s > %s",STTY_BIN,s,name);