public inbox for binutils-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@sourceware.org>
To: bfd-cvs@sourceware.org
Subject: [binutils-gdb] binutils/Dwarf: avoid "shadowing" of glibc function name
Date: Fri,  5 Aug 2022 10:48:29 +0000 (GMT)	[thread overview]
Message-ID: <20220805104829.AA8723858407@sourceware.org> (raw)

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

commit 188bc85476e6ade99bd209ecf430601d56278e64
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri Aug 5 12:48:17 2022 +0200

    binutils/Dwarf: avoid "shadowing" of glibc function name
    
    As before: Old enough glibc has an (unguarded) declaration of index()
    in string.h, which triggers a "shadows a global declaration" warning.

Diff:
---
 binutils/dwarf.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 68104a73786..6574b45ffdf 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -2773,7 +2773,7 @@ read_and_display_attr_value (unsigned long           attribute,
     case DW_FORM_rnglistx:
       if (!do_loc)
 	{
-	  dwarf_vma base, index;
+	  dwarf_vma base, idx;
 	  const char *suffix = strrchr (section->name, '.');
 	  bool dwo = suffix && strcmp (suffix, ".dwo") == 0;
 
@@ -2781,29 +2781,29 @@ read_and_display_attr_value (unsigned long           attribute,
 	    {
 	      if (dwo)
 		{
-		  index = fetch_indexed_value (uvalue, loclists_dwo, 0);
-		  index += (offset_size == 8) ? 20 : 12;
+		  idx = fetch_indexed_value (uvalue, loclists_dwo, 0);
+		  idx += (offset_size == 8) ? 20 : 12;
 		}
 	      else if (debug_info_p == NULL)
 		{
-		  index = fetch_indexed_value (uvalue, loclists, 0);
+		  idx = fetch_indexed_value (uvalue, loclists, 0);
 		}
 	      else
 		{
 		  /* We want to compute:
-		       index = fetch_indexed_value (uvalue, loclists, debug_info_p->loclists_base);
-		       index += debug_info_p->loclists_base;
+		       idx = fetch_indexed_value (uvalue, loclists, debug_info_p->loclists_base);
+		       idx += debug_info_p->loclists_base;
 		      Fortunately we already have that sum cached in the
 		      loc_offsets array.  */
-		  index = debug_info_p->loc_offsets [uvalue];
+		  idx = debug_info_p->loc_offsets [uvalue];
 		}
 	    }
 	  else if (form == DW_FORM_rnglistx)
 	    {
 	      if (dwo)
 		{
-		  index = fetch_indexed_value (uvalue, rnglists_dwo, 0);
-		  index += (offset_size == 8) ? 20 : 12;
+		  idx = fetch_indexed_value (uvalue, rnglists_dwo, 0);
+		  idx += (offset_size == 8) ? 20 : 12;
 		}
 	      else
 		{
@@ -2813,8 +2813,8 @@ read_and_display_attr_value (unsigned long           attribute,
 		    base = debug_info_p->rnglists_base;
 		  /* We do not have a cached value this time, so we perform the
 		     computation manually.  */
-		  index = fetch_indexed_value (uvalue, rnglists, base);
-		  index += base;
+		  idx = fetch_indexed_value (uvalue, rnglists, base);
+		  idx += base;
 		}
 	    }
 	  else
@@ -2827,13 +2827,13 @@ read_and_display_attr_value (unsigned long           attribute,
 		base = debug_info_p->addr_base;
 
 	      base += uvalue * pointer_size;
-	      index = fetch_indexed_addr (base, pointer_size);
+	      idx = fetch_indexed_addr (base, pointer_size);
 	    }
 
 	  /* We have already displayed the form name.  */
 	  printf (_("%c(index: 0x%s): %s"), delimiter,
 		  dwarf_vmatoa ("x", uvalue),
-		  dwarf_vmatoa ("x", index));
+		  dwarf_vmatoa ("x", idx));
 	}
       break;


                 reply	other threads:[~2022-08-05 10:48 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=20220805104829.AA8723858407@sourceware.org \
    --to=jbeulich@sourceware.org \
    --cc=bfd-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).