From: Joel Brobecker Date: Sat, 9 Jan 2010 04:37:12 +0000 (+0000) Subject: -Wunused warning in procfs.c (mips-irix only). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3c95f01ceee3c6d7948075eae81c125dd6dad49b;p=binutils-gdb.git -Wunused warning in procfs.c (mips-irix only). * procfs.c (gdb_praddset, gdb_prdelset): New macros. Use them throughout instead of using praddset and prdelset respectively. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 108476c7590..f562851a90b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2010-01-09 Joel Brobecker + + -Wunused warning in procfs.c (mips-irix only). + * procfs.c (gdb_praddset, gdb_prdelset): New macros. Use them + throughout instead of using praddset and prdelset respectively. + 2010-01-09 Joel Brobecker GDB crash while stepping into function. diff --git a/gdb/procfs.c b/gdb/procfs.c index e5df8866d22..5791ee7427b 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -270,6 +270,15 @@ typedef pr_siginfo64_t gdb_siginfo_t; typedef struct siginfo gdb_siginfo_t; #endif +/* On mips-irix, praddset and prdelset are defined in such a way that + they return a value, which causes GCC to emit a -Wunused error + because the returned value is not used. Prevent this warning + by casting the return value to void. On sparc-solaris, this issue + does not exist because the definition of these macros already include + that cast to void. */ +#define gdb_praddset(sp, flag) ((void) praddset (sp, flag)) +#define gdb_prdelset(sp, flag) ((void) prdelset (sp, flag)) + /* gdb_premptysysset */ #ifdef premptysysset #define gdb_premptysysset premptysysset @@ -281,14 +290,14 @@ typedef struct siginfo gdb_siginfo_t; #ifdef praddsysset #define gdb_praddsysset praddsysset #else -#define gdb_praddsysset praddset +#define gdb_praddsysset gdb_praddset #endif /* prdelsysset */ #ifdef prdelsysset #define gdb_prdelsysset prdelsysset #else -#define gdb_prdelsysset prdelset +#define gdb_prdelsysset gdb_prdelset #endif /* prissyssetmember */ @@ -2219,7 +2228,7 @@ proc_trace_signal (procinfo *pi, int signo) { if (proc_get_traced_signals (pi, &temp)) { - praddset (&temp, signo); + gdb_praddset (&temp, signo); return proc_set_traced_signals (pi, &temp); } } @@ -2253,7 +2262,7 @@ proc_ignore_signal (procinfo *pi, int signo) { if (proc_get_traced_signals (pi, &temp)) { - prdelset (&temp, signo); + gdb_prdelset (&temp, signo); return proc_set_traced_signals (pi, &temp); } } @@ -3491,7 +3500,7 @@ procfs_debug_inferior (procinfo *pi) #else /* Register to trace hardware faults in the child. */ prfillset (&traced_faults); /* trace all faults... */ - prdelset (&traced_faults, FLTPAGE); /* except page fault. */ + gdb_prdelset (&traced_faults, FLTPAGE); /* except page fault. */ #endif if (!proc_set_traced_faults (pi, &traced_faults)) return __LINE__; @@ -4642,9 +4651,9 @@ register_gdb_signals (procinfo *pi, gdb_sigset_t *signals) if (signal_stop_state (target_signal_from_host (signo)) == 0 && signal_print_state (target_signal_from_host (signo)) == 0 && signal_pass_state (target_signal_from_host (signo)) == 1) - prdelset (signals, signo); + gdb_prdelset (signals, signo); else - praddset (signals, signo); + gdb_praddset (signals, signo); return proc_set_traced_signals (pi, signals); }