* [PATCH] sim: fix unused cpu_nr warnings
@ 2010-03-29 22:06 Mike Frysinger
2010-03-30 16:18 ` Tom Tromey
0 siblings, 1 reply; 2+ messages in thread
From: Mike Frysinger @ 2010-03-29 22:06 UTC (permalink / raw)
To: gdb-patches
The trace_option_handler() function only uses cpu_nr when the
SIM_HAVE_ADDR_RANGE define is enabled. So move the decl down
to where the code exists. Otherwise GCC warns:
sim-trace.c: In function 'trace_option_handler':
sim-trace.c:236: warning: unused variable 'cpu_nr'
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
2010-03-29 Mike Frysinger <vapier@gentoo.org>
* sim-trace.c (trace_option_handler): Move cpu_nr decl behind
the SIM_HAVE_ADDR_RANGE define.
sim/common/sim-trace.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sim/common/sim-trace.c b/sim/common/sim-trace.c
index f59b324..2397fe8 100644
--- a/sim/common/sim-trace.c
+++ b/sim/common/sim-trace.c
@@ -241,7 +241,6 @@ trace_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt,
char *arg, int is_command)
{
int n;
- int cpu_nr;
switch (opt)
{
@@ -361,6 +360,7 @@ trace_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt,
case OPTION_TRACE_RANGE :
if (WITH_TRACE)
{
+ int cpu_nr;
char *chp = arg;
unsigned long start,end;
start = strtoul (chp, &chp, 0);
--
1.7.0.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] sim: fix unused cpu_nr warnings
2010-03-29 22:06 [PATCH] sim: fix unused cpu_nr warnings Mike Frysinger
@ 2010-03-30 16:18 ` Tom Tromey
0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2010-03-30 16:18 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb-patches
>>>>> "Mike" == Mike Frysinger <vapier@gentoo.org> writes:
Mike> 2010-03-29 Mike Frysinger <vapier@gentoo.org>
Mike> * sim-trace.c (trace_option_handler): Move cpu_nr decl behind
Mike> the SIM_HAVE_ADDR_RANGE define.
This is ok.
Tom
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-03-30 16:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-29 22:06 [PATCH] sim: fix unused cpu_nr warnings Mike Frysinger
2010-03-30 16:18 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox