Skip to content

Commit dea7c75

Browse files
committed
src/linux/syscall-linux.c: fix build failure on -std=c23
Without the change the build fails due to type mismatch as: linux/syscall-linux.c: In function 'doSyscall': linux/syscall-linux.c:3807:24: error: assignment to '__sighandler_t' {aka 'void (*)(int)'} from incompatible pointer type 'void (*)(void)' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Win tible-pointer-types-Wincompatible-pointer-types8;;] 3807 | act.sa_handler = (void (*)()) (long) sa->lia_handler; | ^ C23 turned `void (*)()` into `void (*)(void)` insteaof partially defined type. Pet's explicitly specify the handler type as used by `sigaction()`.
1 parent 5684831 commit dea7c75

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/linux/syscall-linux.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3804,7 +3804,7 @@ doSyscall (HWORD num, REG arg0, REG arg1, REG arg2, REG arg3, REG arg4,
38043804
act.sa_flags = sa->sa_flags & ~SA_ONSTACK;
38053805
if (sa->lia_handler == (ADDR) SIG_DFL
38063806
|| sa->lia_handler == (ADDR) SIG_IGN)
3807-
act.sa_handler = (void (*)()) (long) sa->lia_handler;
3807+
act.sa_handler = (void (*)(int)) (long) sa->lia_handler;
38083808
else
38093809
act.sa_handler = signal_queue;
38103810
*status = sigaction (arg0, &act, 0);

0 commit comments

Comments
 (0)