From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8577 invoked by alias); 29 Mar 2010 22:06:27 -0000 Received: (qmail 8564 invoked by uid 22791); 29 Mar 2010 22:06:27 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 29 Mar 2010 22:06:22 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 5D94B1B4004 for ; Mon, 29 Mar 2010 22:06:20 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH] sim: fix unused cpu_nr warnings Date: Mon, 29 Mar 2010 22:06:00 -0000 Message-Id: <1269900371-10274-1-git-send-email-vapier@gentoo.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg01028.txt.bz2 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 --- 2010-03-29 Mike Frysinger * 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