Sitelet https://github.com/httperf/httperf/pull/84
Skip to content

Fix build issue with gcc15 - #84

Open
MatthewHartley wants to merge 2 commits into
httperf:masterfrom
MatthewHartley:master
Open

MatthewHartley wants to merge 2 commits into
httperf:masterfrom
MatthewHartley:master

Conversation

@MatthewHartley

Copy link
Copy Markdown

Ever since gcc15 came out, I have had trouble building this project on my gentoo machine, with the error

httperf.c: In function ‘main’:
httperf.c:1384:24: error: passing argument 2 of ‘signal’ from incompatible pointer type [-Wincompatible-pointer-types]
1384 | signal(SIGINT, (void ()()) core_exit);
| ^~~~~~~~~~~~~~~~~~~~~~
| |
| void (
)(void)
In file included from httperf.c:60:
/usr/include/signal.h:88:57: note: expected ‘__sighandler_t’ {aka ‘void ()(int)’} but argument is of type ‘void ()(void)’
88 | extern __sighandler_t signal (int __sig, __sighandler_t __handler)
| ~~~~~~~~~~~~~~~^~~~~~~~~
In file included from httperf.c:81:
./core.h:47:13: note: ‘core_exit’ declared here
47 | extern void core_exit (void);
| ^~~~~~~~~
/usr/include/signal.h:72:16: note: ‘__sighandler_t’ declared here
72 | typedef void (*__sighandler_t) (int);
| ^~~~~~~~~~~~~~

This change fixes the issue on my machine, but tips on how to not break this for people who have been successfully passing in core_exit directly to signal for years would be appreciated!

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.

1 participant