gforth: fix build with GCC 15

This commit is contained in:
Justin Chen
2026-01-03 00:13:32 +08:00
parent f269c98a0d
commit 4204cb5771
2 changed files with 31 additions and 0 deletions
+5
View File
@@ -16,6 +16,11 @@ stdenv.mkDerivation {
sha256 = "1c1bahc9ypmca8rv2dijiqbangm1d9av286904yw48ph7ciz4qig";
};
patches = [
# Newer GCC rejects casting between function pointers omitting parameters
./function-pointers.patch
];
buildInputs = [ m4 ];
configureFlags = lib.optionals stdenv.hostPlatform.isDarwin [ "--build=x86_64-apple-darwin" ];
@@ -0,0 +1,26 @@
diff --git a/engine/signals.c b/engine/signals.c
index b522f19..7f89bcd 100644
--- a/engine/signals.c
+++ b/engine/signals.c
@@ -399,7 +399,7 @@ void install_signal_handlers(void)
#endif
};
int i;
- void (*throw_handler)() = die_on_signal ? graceful_exit : signal_throw;
+ void (*throw_handler)(int) = die_on_signal ? graceful_exit : signal_throw;
#ifdef SIGSTKSZ
stack_t sigstack;
int sas_retval=-1;
diff --git a/engine/support.c b/engine/support.c
index 021fa22..069c32f 100644
--- a/engine/support.c
+++ b/engine/support.c
@@ -79,7 +79,7 @@ char *tilde_cstr(Char *from, UCell size, int clear)
{
char *s1,*s2;
int s1_len, s2_len;
- struct passwd *getpwnam (), *user_entry;
+ struct passwd *getpwnam (const char *), *user_entry;
if (size<1 || from[0]!='~')
return cstr(from, size, clear);