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]

Re: Adding -Wshadow to binutils builds


On Dec 11, 2009, at 2:39 PM, Nick Clifton wrote:

> Hi Tristan,
> 
>> I suppose you didn't try hppa-hpux but AFAIK you can only build it on a native port.  Let me know
>> if you want me to test it.
> 
> Yes please.

It caught a few more cases.

Ok to apply ?

Tristan.

bfd/
2009-12-11  Tristan Gingold  <gingold@adacore.com>

	* som.c (bfd_som_set_subsection_attributes) 
	(bfd_section_from_som_symbol, som_reloc_queue_fix): Fix shadowed
	variable warnings.
	* cache.c (close_one): Likewise.

diff -c -r1.37 cache.c
*** cache.c	9 Sep 2009 21:38:57 -0000	1.37
--- cache.c	11 Dec 2009 14:03:59 -0000
***************
*** 144,176 ****
  static bfd_boolean
  close_one (void)
  {
!   register bfd *kill;
  
    if (bfd_last_cache == NULL)
!     kill = NULL;
    else
      {
!       for (kill = bfd_last_cache->lru_prev;
! 	   ! kill->cacheable;
! 	   kill = kill->lru_prev)
  	{
! 	  if (kill == bfd_last_cache)
  	    {
! 	      kill = NULL;
  	      break;
  	    }
  	}
      }
  
!   if (kill == NULL)
      {
        /* There are no open cacheable BFD's.  */
        return TRUE;
      }
  
!   kill->where = real_ftell ((FILE *) kill->iostream);
  
!   return bfd_cache_delete (kill);
  }
  
  /* Check to see if the required BFD is the same as the last one
--- 144,176 ----
  static bfd_boolean
  close_one (void)
  {
!   register bfd *to_kill;
  
    if (bfd_last_cache == NULL)
!     to_kill = NULL;
    else
      {
!       for (to_kill = bfd_last_cache->lru_prev;
! 	   ! to_kill->cacheable;
! 	   to_kill = to_kill->lru_prev)
  	{
! 	  if (to_kill == bfd_last_cache)
  	    {
! 	      to_kill = NULL;
  	      break;
  	    }
  	}
      }
  
!   if (to_kill == NULL)
      {
        /* There are no open cacheable BFD's.  */
        return TRUE;
      }
  
!   to_kill->where = real_ftell ((FILE *) to_kill->iostream);
  
!   return bfd_cache_delete (to_kill);
  }
  
  /* Check to see if the required BFD is the same as the last one
Index: som.c
===================================================================
RCS file: /cvs/src/src/bfd/som.c,v
retrieving revision 1.77
diff -c -r1.77 som.c
*** som.c	23 Nov 2009 14:41:30 -0000	1.77
--- som.c	11 Dec 2009 14:04:00 -0000
***************
*** 982,993 ****
     to the front of the queue.  */
  
  static void
! som_reloc_queue_fix (struct reloc_queue *queue, unsigned int index)
  {
!   if (index == 0)
      return;
  
!   if (index == 1)
      {
        unsigned char *tmp1 = queue[0].reloc;
        unsigned int tmp2 = queue[0].size;
--- 982,993 ----
     to the front of the queue.  */
  
  static void
! som_reloc_queue_fix (struct reloc_queue *queue, unsigned int idx)
  {
!   if (idx == 0)
      return;
  
!   if (idx == 1)
      {
        unsigned char *tmp1 = queue[0].reloc;
        unsigned int tmp2 = queue[0].size;
***************
*** 999,1005 ****
        return;
      }
  
!   if (index == 2)
      {
        unsigned char *tmp1 = queue[0].reloc;
        unsigned int tmp2 = queue[0].size;
--- 999,1005 ----
        return;
      }
  
!   if (idx == 2)
      {
        unsigned char *tmp1 = queue[0].reloc;
        unsigned int tmp2 = queue[0].size;
***************
*** 1013,1019 ****
        return;
      }
  
!   if (index == 3)
      {
        unsigned char *tmp1 = queue[0].reloc;
        unsigned int tmp2 = queue[0].size;
--- 1013,1019 ----
        return;
      }
  
!   if (idx == 3)
      {
        unsigned char *tmp1 = queue[0].reloc;
        unsigned int tmp2 = queue[0].size;
***************
*** 4239,4248 ****
  	  && symbol->symbol_type != ST_SEC_PROG
  	  && symbol->symbol_type != ST_MILLICODE))
      {
!       int index = symbol->symbol_info;
  
        for (section = abfd->sections; section != NULL; section = section->next)
! 	if (section->target_index == index && som_is_subspace (section))
  	  return section;
      }
    else
--- 4239,4248 ----
  	  && symbol->symbol_type != ST_SEC_PROG
  	  && symbol->symbol_type != ST_MILLICODE))
      {
!       int idx = symbol->symbol_info;
  
        for (section = abfd->sections; section != NULL; section = section->next)
! 	if (section->target_index == idx && som_is_subspace (section))
  	  return section;
      }
    else
***************
*** 5177,5183 ****
  bfd_boolean
  bfd_som_set_subsection_attributes (asection *section,
  				   asection *container,
! 				   int access,
  				   unsigned int sort_key,
  				   int quadrant,
  				   int comdat,
--- 5177,5183 ----
  bfd_boolean
  bfd_som_set_subsection_attributes (asection *section,
  				   asection *container,
! 				   int access_ctr,
  				   unsigned int sort_key,
  				   int quadrant,
  				   int comdat,
***************
*** 5194,5200 ****
  	return FALSE;
      }
    som_section_data (section)->copy_data->sort_key = sort_key;
!   som_section_data (section)->copy_data->access_control_bits = access;
    som_section_data (section)->copy_data->quadrant = quadrant;
    som_section_data (section)->copy_data->container = container;
    som_section_data (section)->copy_data->is_comdat = comdat;
--- 5194,5200 ----
  	return FALSE;
      }
    som_section_data (section)->copy_data->sort_key = sort_key;
!   som_section_data (section)->copy_data->access_control_bits = access_ctr;
    som_section_data (section)->copy_data->quadrant = quadrant;
    som_section_data (section)->copy_data->container = container;
    som_section_data (section)->copy_data->is_comdat = comdat;


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