Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handle_sigterm_pid1() signature #663

Merged
merged 2 commits into from
Mar 18, 2025
Merged

Conversation

apoikos
Copy link
Contributor

@apoikos apoikos commented Mar 17, 2025

This is a signal handler, so it should accept a signal number as the only argument, otherwise GCC 15 fails with the following error:

  main.c: In function 'set_sig_handlers':
  main.c:75:23: error: assignment to '__sighandler_t' {aka 'void (*)(int)'} from incompatible pointer type 'void (*)(void)' [-Wincompatible-pointer-types]
     75 |         sa.sa_handler = handle_sigterm_pid1;
        |                       ^
  main.c:40:1: note: 'handle_sigterm_pid1' declared here
     40 | handle_sigterm_pid1()
        | ^~~~~~~~~~~~~~~~~~~
  In file included from main.c:3:
  /usr/include/signal.h:72:16: note: '__sighandler_t' declared here
     72 | typedef void (*__sighandler_t) (int);
        |                ^~~~~~~~~~~~~~

See also https://bugs.debian.org/1096364.

apoikos and others added 2 commits March 17, 2025 11:23
This is a signal handler, so it should accept a signal number as the
only argument, otherwise GCC 15 fails with the following error:

  main.c: In function 'set_sig_handlers':
  main.c:75:23: error: assignment to '__sighandler_t' {aka 'void (*)(int)'} from incompatible pointer type 'void (*)(void)' [-Wincompatible-pointer-types]
     75 |         sa.sa_handler = handle_sigterm_pid1;
        |                       ^
  main.c:40:1: note: 'handle_sigterm_pid1' declared here
     40 | handle_sigterm_pid1()
        | ^~~~~~~~~~~~~~~~~~~
  In file included from main.c:3:
  /usr/include/signal.h:72:16: note: '__sighandler_t' declared here
     72 | typedef void (*__sighandler_t) (int);
        |                ^~~~~~~~~~~~~~

See also https://bugs.debian.org/1096364.
@ysmolski ysmolski merged commit 8507076 into beanstalkd:master Mar 18, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants