public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jon TURNEY <jturney@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] Fix a new warning on Cygwin
Date: Thu,  2 Jun 2022 09:40:51 +0000 (GMT)	[thread overview]
Message-ID: <20220602094051.5F84F395A066@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a7790128481894630414213603d3e894d764f802

commit a7790128481894630414213603d3e894d764f802
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Sat May 21 11:18:55 2022 +0100

    Fix a new warning on Cygwin
    
    > ../../gdb/windows-nat.c: In function ‘windows_solib* windows_make_so(const char*, LPVOID)’:
    > ../../gdb/windows-nat.c:714:12: error: declaration of ‘char name [512]’ shadows a parameter [-Werror=shadow=compatible-local]
    >   714 |       char name[SO_NAME_MAX_PATH_SIZE];
    >       |            ^~~~
    > ../../gdb/windows-nat.c:655:30: note: shadowed declaration is here
    >   655 | windows_make_so (const char *name, LPVOID load_addr)
    >       |                  ~~~~~~~~~~~~^~~~

Diff:
---
 gdb/windows-nat.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index b98848bbc70..8631a1b4569 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -711,10 +711,10 @@ windows_make_so (const char *name, LPVOID load_addr)
 #else
   if (buf[0])
     {
-      char name[SO_NAME_MAX_PATH_SIZE];
-      cygwin_conv_path (CCP_WIN_W_TO_POSIX, buf, name,
+      char cname[SO_NAME_MAX_PATH_SIZE];
+      cygwin_conv_path (CCP_WIN_W_TO_POSIX, buf, cname,
 			SO_NAME_MAX_PATH_SIZE);
-      so->name = name;
+      so->name = cname;
     }
   else
     {


                 reply	other threads:[~2022-06-02  9:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220602094051.5F84F395A066@sourceware.org \
    --to=jturney@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).