public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Fix a new warning on Cygwin
@ 2022-06-02  9:40 Jon TURNEY
  0 siblings, 0 replies; only message in thread
From: Jon TURNEY @ 2022-06-02  9:40 UTC (permalink / raw)
  To: gdb-cvs

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
     {


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-02  9:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02  9:40 [binutils-gdb] Fix a new warning on Cygwin Jon TURNEY

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).