Skip to content

Commit 3c95f01

Browse files
author
Joel Brobecker
committed
-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.
1 parent 4b7703a commit 3c95f01

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

gdb/ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2010-01-09 Joel Brobecker <[email protected]>
2+
3+
-Wunused warning in procfs.c (mips-irix only).
4+
* procfs.c (gdb_praddset, gdb_prdelset): New macros. Use them
5+
throughout instead of using praddset and prdelset respectively.
6+
17
2010-01-09 Joel Brobecker <[email protected]>
28

39
GDB crash while stepping into function.

gdb/procfs.c

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,15 @@ typedef pr_siginfo64_t gdb_siginfo_t;
270270
typedef struct siginfo gdb_siginfo_t;
271271
#endif
272272

273+
/* On mips-irix, praddset and prdelset are defined in such a way that
274+
they return a value, which causes GCC to emit a -Wunused error
275+
because the returned value is not used. Prevent this warning
276+
by casting the return value to void. On sparc-solaris, this issue
277+
does not exist because the definition of these macros already include
278+
that cast to void. */
279+
#define gdb_praddset(sp, flag) ((void) praddset (sp, flag))
280+
#define gdb_prdelset(sp, flag) ((void) prdelset (sp, flag))
281+
273282
/* gdb_premptysysset */
274283
#ifdef premptysysset
275284
#define gdb_premptysysset premptysysset
@@ -281,14 +290,14 @@ typedef struct siginfo gdb_siginfo_t;
281290
#ifdef praddsysset
282291
#define gdb_praddsysset praddsysset
283292
#else
284-
#define gdb_praddsysset praddset
293+
#define gdb_praddsysset gdb_praddset
285294
#endif
286295

287296
/* prdelsysset */
288297
#ifdef prdelsysset
289298
#define gdb_prdelsysset prdelsysset
290299
#else
291-
#define gdb_prdelsysset prdelset
300+
#define gdb_prdelsysset gdb_prdelset
292301
#endif
293302

294303
/* prissyssetmember */
@@ -2219,7 +2228,7 @@ proc_trace_signal (procinfo *pi, int signo)
22192228
{
22202229
if (proc_get_traced_signals (pi, &temp))
22212230
{
2222-
praddset (&temp, signo);
2231+
gdb_praddset (&temp, signo);
22232232
return proc_set_traced_signals (pi, &temp);
22242233
}
22252234
}
@@ -2253,7 +2262,7 @@ proc_ignore_signal (procinfo *pi, int signo)
22532262
{
22542263
if (proc_get_traced_signals (pi, &temp))
22552264
{
2256-
prdelset (&temp, signo);
2265+
gdb_prdelset (&temp, signo);
22572266
return proc_set_traced_signals (pi, &temp);
22582267
}
22592268
}
@@ -3491,7 +3500,7 @@ procfs_debug_inferior (procinfo *pi)
34913500
#else
34923501
/* Register to trace hardware faults in the child. */
34933502
prfillset (&traced_faults); /* trace all faults... */
3494-
prdelset (&traced_faults, FLTPAGE); /* except page fault. */
3503+
gdb_prdelset (&traced_faults, FLTPAGE); /* except page fault. */
34953504
#endif
34963505
if (!proc_set_traced_faults (pi, &traced_faults))
34973506
return __LINE__;
@@ -4642,9 +4651,9 @@ register_gdb_signals (procinfo *pi, gdb_sigset_t *signals)
46424651
if (signal_stop_state (target_signal_from_host (signo)) == 0 &&
46434652
signal_print_state (target_signal_from_host (signo)) == 0 &&
46444653
signal_pass_state (target_signal_from_host (signo)) == 1)
4645-
prdelset (signals, signo);
4654+
gdb_prdelset (signals, signo);
46464655
else
4647-
praddset (signals, signo);
4656+
gdb_praddset (signals, signo);
46484657

46494658
return proc_set_traced_signals (pi, signals);
46504659
}

0 commit comments

Comments
 (0)