This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch/obv]: Fix -Wshadow warnings in DEBUG code


Hi,

this patch fixes debug code in write.c (enabled by DEBUG3/DEBUG4) that generates -Wshadow warning.

Committed as obvious.

Tristan.

2011-08-01  Tristan Gingold  <gingold@adacore.com>

	* write.c (write_relocs): Fix -Wshadow in DEBUG3 and DEBUG4.

RCS file: /cvs/src/src/gas/write.c,v
retrieving revision 1.141
diff -c -r1.141 write.c
*** write.c	6 May 2011 14:48:56 -0000	1.141
--- write.c	1 Aug 2011 08:53:19 -0000
***************
*** 1233,1247 ****
  
  #ifdef DEBUG4
    {
!     unsigned int i, j, nsyms;
      asymbol **sympp;
      sympp = bfd_get_outsymbols (stdoutput);
      nsyms = bfd_get_symcount (stdoutput);
!     for (i = 0; i < n; i++)
!       if (((*relocs[i]->sym_ptr_ptr)->flags & BSF_SECTION_SYM) == 0)
  	{
  	  for (j = 0; j < nsyms; j++)
! 	    if (sympp[j] == *relocs[i]->sym_ptr_ptr)
  	      break;
  	  if (j == nsyms)
  	    abort ();
--- 1233,1247 ----
  
  #ifdef DEBUG4
    {
!     unsigned int k, j, nsyms;
      asymbol **sympp;
      sympp = bfd_get_outsymbols (stdoutput);
      nsyms = bfd_get_symcount (stdoutput);
!     for (k = 0; k < n; k++)
!       if (((*relocs[k]->sym_ptr_ptr)->flags & BSF_SECTION_SYM) == 0)
  	{
  	  for (j = 0; j < nsyms; j++)
! 	    if (sympp[j] == *relocs[k]->sym_ptr_ptr)
  	      break;
  	  if (j == nsyms)
  	    abort ();
***************
*** 1280,1295 ****
  
  #ifdef DEBUG3
    {
!     unsigned int i;
!     arelent *r;
!     asymbol *s;
      fprintf (stderr, "relocs for sec %s\n", sec->name);
!     for (i = 0; i < n; i++)
        {
! 	r = relocs[i];
! 	s = *r->sym_ptr_ptr;
  	fprintf (stderr, "  reloc %2d @%p off %4lx : sym %-10s addend %lx\n",
! 		 i, r, (unsigned long)r->address, s->name, (unsigned long)r->addend);
        }
    }
  #endif
--- 1280,1295 ----
  
  #ifdef DEBUG3
    {
!     unsigned int k;
! 
      fprintf (stderr, "relocs for sec %s\n", sec->name);
!     for (k = 0; k < n; k++)
        {
!         arelent *rel = relocs[k];
!         asymbol *s = *rel->sym_ptr_ptr;
  	fprintf (stderr, "  reloc %2d @%p off %4lx : sym %-10s addend %lx\n",
! 		 k, rel, (unsigned long)rel->address, s->name,
!                  (unsigned long)rel->addend);
        }
    }
  #endif


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]