[PATCH] stacktrace: fix a C23-ism in sigint_handler
Sam James
sam@gentoo.org
Wed Feb 4 16:50:38 GMT 2026
Mark Wielaard <mark@klomp.org> writes:
> clang 21 doesn't like ommitting a parameter name when not in C23 mode.
One of the things you and I discussed a little while ago ;)
You can use -Wmissing-parameter-name to catch this in GCC, btw.
>
> stacktrace.c:1138:44: error: omitting the parameter name in a function definition is a C23 extension [-Werror,-Wc23-extensions]
> 1138 | static void sigint_handler (int /* signo */)
> | ^
> 1 error generated.
>
> * src/stacktrace.c (sigint_handler): Use attribute unused.
>
> Signed-off-by: Mark Wielaard <mark@klomp.org>
> ---
> src/stacktrace.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/stacktrace.c b/src/stacktrace.c
> index c330e6465043..1c9faeeb3059 100644
> --- a/src/stacktrace.c
> +++ b/src/stacktrace.c
> @@ -1135,7 +1135,7 @@ sysprof_unwind_cb (SysprofCaptureFrame *frame, void *arg)
> ****************/
>
> /* Required to match our signal handling with that of a sysprof parent process. */
> -static void sigint_handler (int /* signo */)
> +static void sigint_handler (int signo __attribute__ ((unused)))
> {
> if (signal_count >= 2)
> {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 418 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/elfutils-devel/attachments/20260204/a28c631e/attachment.sig>
More information about the Elfutils-devel
mailing list