/home/cqwrteur/toolchains_build/binutils-gdb/sim/common/nrun.c:150:23: error: assignment to 'void (*)(void)' from incompatible pointer type '__sighandler_t' {aka 'void (*)(int)'} [-Wincompatible-pointer-types] 150 | prev_sigint = signal (SIGINT, cntrl_c); | ^ /home/cqwrteur/toolchains_build/binutils-gdb/sim/common/nrun.c:152:27: error: passing argument 2 of 'signal' from incompatible pointer type [-Wincompatible-pointer-types] 152 | signal (SIGINT, prev_sigint); | ^~~~~~~~~~~ | | | void (*)(void) In file included from ../gnulib/import/signal.h:52, from /home/cqwrteur/toolchains_build/binutils-gdb/sim/common/nrun.c:20: /home/cqwrteur/toolchains/x86_64-linux-gnu/x86_64-linux-gnu/sysroot/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) | ~~~~~~~~~~~~~~~^~~~~~~~~ /home/cqwrteur/toolchains_build/binutils-gdb/sim/common/nrun.c:175:23: error: assignment to 'void (*)(void)' from incompatible pointer type '__sighandler_t' {aka 'void (*)(int)'} [-Wincompatible-pointer-types] 175 | prev_sigint = osa.sa_handler; | ^ /home/cqwrteur/toolchains_build/binutils-gdb/sim/common/nrun.c:180:27: error: passing argument 2 of 'signal' from incompatible pointer type [-Wincompatible-pointer-types] 180 | signal (SIGINT, prev_sigint); | ^~~~~~~~~~~ | | | void (*)(void) /home/cqwrteur/toolchains/x86_64-linux-gnu/x86_64-linux-gnu/sysroot/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) | ~~~~~~~~~~~~~~~^~~~~~~~~ yes checking for execinfo.h... yes make[3]: *** [Makefile:5167: aarch64/nrun.o] Error 1 make[3]: *** Waiting for unfinished jobs....
The sim code is part of GDB not the binutils, so I have changed the Product field
What compiler are you using? prev_sigint is: RETSIGTYPE (*prev_sigint) (); Which isn't the same as (void). Maybe this is a C23 thing though.
https://sourceware.org/pipermail/gdb-patches/2024-December/214149.html
gcc 15 On Dec 16, 2024 10:40, tromey at sourceware dot org <sourceware-bugzilla@sourceware.org> wrote: https://sourceware.org/bugzilla/show_bug.cgi?id=32466 Tom Tromey <tromey at sourceware dot org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tromey at sourceware dot org --- Comment #2 from Tom Tromey <tromey at sourceware dot org> --- What compiler are you using? prev_sigint is: RETSIGTYPE (*prev_sigint) (); Which isn't the same as (void). Maybe this is a C23 thing though. -- You are receiving this mail because: You reported the bug. You are on the CC list for the bug.
The master branch has been updated by Tom Tromey <tromey@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7a8cc0983ae3b954cba68dc874b0b0e738347e79 commit 7a8cc0983ae3b954cba68dc874b0b0e738347e79 Author: Tom Tromey <tom@tromey.com> Date: Mon Dec 16 09:12:48 2024 -0700 Use correct type for saved signal handler A user noticed that the sim assigns the result of a call to 'signal' to a variable like: RETSIGTYPE (*prev_sigint) (); However, it's more correct to use (int) here. This patch fixes the error. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32466 Approved-By: Andrew Burgess <aburgess@redhat.com>
Fixed.