From a40805d4a73532dffc61e33f913e62b93214c998 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 27 Aug 2015 13:26:23 +0100 Subject: gdb: Use sighandler_t everywhere MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes 14 build errors like these in C++ mode: src/gdb/extension.c: In function ‘void install_sigint_handler(const signal_handler*)’: src/gdb/extension.c:698:41: error: invalid conversion from ‘void (*)()’ to ‘__sighandler_t {aka void (*)(int)}’ [-fpermissive] signal (SIGINT, handler_state->handler); ^ In file included from build-gnulib/import/signal.h:52:0, from ../../src/gdb/extension.c:24: /usr/include/signal.h:102:23: error: initializing argument 2 of ‘void (* signal(int, __sighandler_t))(int)’ [-fpermissive] extern __sighandler_t signal (int __sig, __sighandler_t __handler) ^ Instead of this everywhere: - RETSIGTYPE (*handle_sigint_for_compare) () = handle_sigint; + RETSIGTYPE (*handle_sigint_for_compare) (int) = handle_sigint; Use sighandler_t (a GNU extension). That's OK to use unconditionaly because gnulib's signal.h replacement makes sure that it is available. gdb/ChangeLog: 2015-08-27 Pedro Alves * cp-support.c (gdb_demangle): Use sighandler_t. Remove cast. * extension-priv.h: Include signal.h. (struct signal_handler) : Change type to sighandler_t. * extension.c (install_gdb_sigint_handler): Use sighandler_t. * inflow.c (sigint_ours, sigquit_ours): Change type to sighandler_t. (child_terminal_inferior): Remove casts. (child_terminal_ours_1, new_tty): Use sighandler_t. Remove casts. (osig): Change type to sighandler_t. * nto-procfs.c (ofunc): Change type to sighandler_t. (procfs_wait): Remove casts. * remote-m32r-sdi.c (m32r_wait, m32r_load): Use sighandler_t. * remote-sim.c (gdbsim_wait): Use sighandler_t. * utils.c (wait_to_die_with_timeout): Use sighandler_t. --- gdb/extension-priv.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gdb/extension-priv.h') diff --git a/gdb/extension-priv.h b/gdb/extension-priv.h index d0242e2..dd7326e 100644 --- a/gdb/extension-priv.h +++ b/gdb/extension-priv.h @@ -22,6 +22,7 @@ #define EXTENSION_PRIV_H #include "extension.h" +#include /* The return code for some API calls. */ @@ -329,7 +330,7 @@ struct signal_handler int handler_saved; /* The signal handler. */ - RETSIGTYPE (*handler) (); + sighandler_t handler; }; /* State necessary to restore the currently active extension language -- cgit v1.1