From c5fe8107bc3c2a2c0a5f3b07ae999dfaa8f3d573 Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Sun, 26 Sep 2004 13:38:49 -0700 Subject: [PATCH] prims.cc (unblock_signal): Annotate signum with __unused__ to avoid warnings in the non-POSIX_VERSION case. * prims.cc (unblock_signal): Annotate signum with __unused__ to avoid warnings in the non-POSIX_VERSION case. Also, we only need this function if either HANDLE_SEGV or HANDLE_FPE, so place it inside an #if block. * include/default-signal.h (SIGNAL_HANDLER): Parameters are __unused__. * include/i386-signal.h (SIGNAL_HANDLER): Likewise * include/mips-signal.h (SIGNAL_HANDLER): Likewise * include/sparc-signal.h (SIGNAL_HANDLER): Likewise From-SVN: r88148 --- libjava/ChangeLog | 11 +++++++++++ libjava/include/default-signal.h | 2 +- libjava/include/i386-signal.h | 2 +- libjava/include/mips-signal.h | 4 +++- libjava/include/sparc-signal.h | 4 +++- libjava/prims.cc | 4 +++- 6 files changed, 22 insertions(+), 5 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 1901c4aae02..2794b78266f 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,14 @@ +2004-09-26 Per Bothner + + * prims.cc (unblock_signal): Annotate signum with __unused__ to + avoid warnings in the non-POSIX_VERSION case. + Also, we only need this function if either HANDLE_SEGV or HANDLE_FPE, + so place it inside an #if block. + * include/default-signal.h (SIGNAL_HANDLER): Parameters are __unused__. + * include/i386-signal.h (SIGNAL_HANDLER): Likewise + * include/mips-signal.h (SIGNAL_HANDLER): Likewise + * include/sparc-signal.h (SIGNAL_HANDLER): Likewise + 2004-09-26 Per Bothner * prims.cc (process_gcj_properties): Optimization. diff --git a/libjava/include/default-signal.h b/libjava/include/default-signal.h index 1c50f5f7ec3..6aea73468f5 100644 --- a/libjava/include/default-signal.h +++ b/libjava/include/default-signal.h @@ -19,7 +19,7 @@ details. */ #include #define SIGNAL_HANDLER(_name) \ -static void _name (int _dummy) +static void _name (int _dummy __attribute__ ((__unused__))) #define INIT_SEGV \ do \ diff --git a/libjava/include/i386-signal.h b/libjava/include/i386-signal.h index 81959725c06..f7b0edae622 100644 --- a/libjava/include/i386-signal.h +++ b/libjava/include/i386-signal.h @@ -20,7 +20,7 @@ details. */ #define HANDLE_FPE 1 #define SIGNAL_HANDLER(_name) \ -static void _name (int _dummy) +static void _name (int _dummy __attribute__ ((__unused__))) #define MAKE_THROW_FRAME(_exception) \ do \ diff --git a/libjava/include/mips-signal.h b/libjava/include/mips-signal.h index 0f77e475dd2..732ba0b1f67 100644 --- a/libjava/include/mips-signal.h +++ b/libjava/include/mips-signal.h @@ -54,7 +54,9 @@ struct kernel_sigaction { #define SIGNAL_HANDLER(_name) \ -static void _name (int _dummy, siginfo_t *_info, sig_ucontext_t *_arg) +static void _name (int _dummy __attribute__ ((__unused__)), \ + siginfo_t *_info __attribute__ ((__unused__)), \ + sig_ucontext_t *_arg __attribute__ ((__unused__))) /* * MIPS leaves pc pointing at the faulting instruction, but the diff --git a/libjava/include/sparc-signal.h b/libjava/include/sparc-signal.h index 1676d26396b..eb7f2b39d95 100644 --- a/libjava/include/sparc-signal.h +++ b/libjava/include/sparc-signal.h @@ -18,7 +18,9 @@ details. */ #define HANDLE_FPE 1 #define SIGNAL_HANDLER(_name) \ -static void _name (int _dummy, siginfo_t *_info, void *arg) +static void _name (int _dummy __attribute__ ((__unused__)), \ + siginfo_t *_info __attribute__ ((__unused__)), \ + void *arg __attribute__ ((__unused__))) #ifdef __arch64__ #define FLUSH_REGISTER_WINDOWS \ diff --git a/libjava/prims.cc b/libjava/prims.cc index 7511906b19a..70ede2765cb 100644 --- a/libjava/prims.cc +++ b/libjava/prims.cc @@ -125,10 +125,11 @@ void (*_Jv_JVMPI_Notify_THREAD_END) (JVMPI_Event *event); #endif +#if defined (HANDLE_SEGV) || defined(HANDLE_FPE) /* Unblock a signal. Unless we do this, the signal may only be sent once. */ static void -unblock_signal (int signum) +unblock_signal (int signum __attribute__ ((__unused__))) { #ifdef _POSIX_VERSION sigset_t sigs; @@ -138,6 +139,7 @@ unblock_signal (int signum) sigprocmask (SIG_UNBLOCK, &sigs, NULL); #endif } +#endif #ifdef HANDLE_SEGV SIGNAL_HANDLER (catch_segv) -- 2.30.2