From patchwork Thu Jan 15 03:26:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joel Brobecker X-Patchwork-Id: 4691 Received: (qmail 20530 invoked by alias); 15 Jan 2015 03:27:06 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 20492 invoked by uid 89); 15 Jan 2015 03:27:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 15 Jan 2015 03:27:00 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 9797E116608; Wed, 14 Jan 2015 22:26:58 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id G31fAhMMsw+Y; Wed, 14 Jan 2015 22:26:58 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 2849A116607; Wed, 14 Jan 2015 22:26:58 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 6B09D48E8B; Thu, 15 Jan 2015 07:26:54 +0400 (RET) Date: Thu, 15 Jan 2015 07:26:54 +0400 From: Joel Brobecker To: Daniel Calcoen Cc: "gdb-patches@sourceware.org" Subject: Re: sim/rx/gdb-if.c variable name collision Message-ID: <20150115032654.GL8167@adacore.com> References: <46996EF9723066478746F941CF170BB8D78703EB@CERNXCHG44.cern.ch> <46996EF9723066478746F941CF170BB8D7870402@CERNXCHG44.cern.ch> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <46996EF9723066478746F941CF170BB8D7870402@CERNXCHG44.cern.ch> User-Agent: Mutt/1.5.21 (2010-09-15) > I built binutils (from master) for linux without problems. > > When I try to build the same source/target but now using x64-mingw32 I get a name collision with a local variable name “open” declared in line 64 of/sim/rx/gdb-if.c, > > used in lines 64,82 and 101. Thanks for the report. > Could this variable be renamed? And commited? > > Once renamed the compilation went fine. > > I'm not aware of the naming conventions used by gdb people this is why > I didn't propose a patch. Often, we'll use a prefix. In this case, I used "rx_", and renamed the variable to "rx_sim_is_open". sim/rx/ChangeLog: * gdb-if.c (open): Rename to... (rx_sim_is_open): This. Replace all uses of "open" by uses of "rx_sim_is_open" throughout. Tested by rebuilding on x86_64-linux. Pushed on master and gdb-7.9-branch. From a300380e12ca04a6cb900e9bfd26161b3fe56ed8 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Thu, 15 Jan 2015 07:14:45 +0400 Subject: [PATCH] Build failure in sim/rx/gdb-if.c on windows This should fix a build failure reported on x86_64-mingw32 by Daniel Calcoen due to conflicting declarations of "open". This patch just renames the static global in sim/rx/gdb-if.c into "rx_sim_is_open". sim/rx/ChangeLog: * gdb-if.c (open): Rename to... (rx_sim_is_open): This. Replace all uses of "open" by uses of "rx_sim_is_open" throughout. Tested by rebuilding on x86_64-linux. --- sim/rx/ChangeLog | 6 ++++++ sim/rx/gdb-if.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sim/rx/ChangeLog b/sim/rx/ChangeLog index 3c1c4e5..8d4c4ec 100644 --- a/sim/rx/ChangeLog +++ b/sim/rx/ChangeLog @@ -1,3 +1,9 @@ +2015-12-15 Joel Brobecker + + * gdb-if.c (open): Rename to... + (rx_sim_is_open): This. Replace all uses of "open" by uses of + "rx_sim_is_open" throughout. + 2014-08-19 Alan Modra * configure: Regenerate. diff --git a/sim/rx/gdb-if.c b/sim/rx/gdb-if.c index 7af5b00..762c3d2 100644 --- a/sim/rx/gdb-if.c +++ b/sim/rx/gdb-if.c @@ -54,14 +54,14 @@ static struct sim_state the_minisim = { "This is the sole rx minisim instance. See libsim.a's global variables." }; -static int open; +static int rx_sim_is_open; SIM_DESC sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *callback, struct bfd *abfd, char **argv) { - if (open) + if (rx_sim_is_open) fprintf (stderr, "rx minisim: re-opened sim\n"); /* The 'run' interface doesn't use this function, so we don't care @@ -79,7 +79,7 @@ sim_open (SIM_OPEN_KIND kind, execution_error_init_debugger (); sim_disasm_init (abfd); - open = 1; + rx_sim_is_open = 1; return &the_minisim; } @@ -98,7 +98,7 @@ sim_close (SIM_DESC sd, int quitting) /* Not much to do. At least free up our memory. */ init_mem (); - open = 0; + rx_sim_is_open = 0; } static bfd * -- 1.9.1