aboutsummaryrefslogtreecommitdiff
path: root/gdb/nto-procfs.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-08-27 13:26:23 +0100
committerPedro Alves <palves@redhat.com>2015-08-27 13:26:23 +0100
commita40805d4a73532dffc61e33f913e62b93214c998 (patch)
tree7d6bfce7bf8e0c583c600dcfd5966a8f5c155c67 /gdb/nto-procfs.c
parent0750520d890bd6ac3ba958a921fbeebe5915e50f (diff)
downloadgdb-a40805d4a73532dffc61e33f913e62b93214c998.zip
gdb-a40805d4a73532dffc61e33f913e62b93214c998.tar.gz
gdb-a40805d4a73532dffc61e33f913e62b93214c998.tar.bz2
gdb: Use sighandler_t everywhere
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 <palves@redhat.com> * cp-support.c (gdb_demangle): Use sighandler_t. Remove cast. * extension-priv.h: Include signal.h. (struct signal_handler) <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.
Diffstat (limited to 'gdb/nto-procfs.c')
-rw-r--r--gdb/nto-procfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c
index 2d1c49a..20b05be 100644
--- a/gdb/nto-procfs.c
+++ b/gdb/nto-procfs.c
@@ -47,7 +47,7 @@
int ctl_fd;
-static void (*ofunc) ();
+static sighandler_t ofunc;
static procfs_run run;
@@ -735,7 +735,7 @@ procfs_wait (struct target_ops *ops,
devctl (ctl_fd, DCMD_PROC_STATUS, &status, sizeof (status), 0);
while (!(status.flags & _DEBUG_FLAG_ISTOP))
{
- ofunc = (void (*)()) signal (SIGINT, nto_handle_sigint);
+ ofunc = signal (SIGINT, nto_handle_sigint);
sigwaitinfo (&set, &info);
signal (SIGINT, ofunc);
devctl (ctl_fd, DCMD_PROC_STATUS, &status, sizeof (status), 0);