This is the mail archive of the binutils@sources.redhat.com 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]

Re: [patch] to binutils: build problem: no type-cast on the left side of =


Nick Clifton <nickc@redhat.com> wrote:

> Approved...
>
> ...but please could you also change the type of the 'info' field of
> the 'struct unw_aux_info' from "const unsigned char *" to "unsigned
> char *" (line 3102) so that we do not get compile time warnings about
> the calls to fread() and free() from inside GET_DATA_ALLOC from
> discarding the const.

I have checked in the revised patch below.

-- 
Michael Sokolov
Public Service Agent
International Engineering and Science Task Force

1351 VINE AVE APT 27		Phone: +1-714-738-5409
FULLERTON CA 92833-4291 USA	(home office)

E-mail: msokolov@ivan.Harhan.ORG (ARPA TCP/SMTP)

2001-02-11  Michael Sokolov  <msokolov@ivan.Harhan.ORG>

	* readelf.c (struct unw_aux_info): Remove const from the info member.
	(process_unwind): Don't type-cast the third argument to the
	GET_DATA_ALLOC macro.

Index: readelf.c
===================================================================
RCS file: /cvs/src/src/binutils/readelf.c,v
retrieving revision 1.90
diff -p -r1.90 readelf.c
*** readelf.c	2001/02/11 22:14:01	1.90
--- readelf.c	2001/02/11 23:05:49
*************** struct unw_aux_info
*** 3099,3105 ****
        }
      *table;				/* Unwind table.  */
      unsigned long         table_len;	/* Length of unwind table.  */
!     const unsigned char * info;		/* Unwind info.  */
      unsigned long         info_size;	/* Size of unwind info.  */
      bfd_vma               info_addr;	/* starting address of unwind info.  */
      bfd_vma               seg_base;	/* Starting address of segment.  */
--- 3099,3105 ----
        }
      *table;				/* Unwind table.  */
      unsigned long         table_len;	/* Length of unwind table.  */
!     unsigned char *       info;		/* Unwind info.  */
      unsigned long         info_size;	/* Size of unwind info.  */
      bfd_vma               info_addr;	/* starting address of unwind info.  */
      bfd_vma               seg_base;	/* Starting address of segment.  */
*************** process_unwind (file)
*** 3400,3406 ****
  	{
  	  aux.info_size = sec->sh_size;
  	  aux.info_addr = sec->sh_addr;
! 	  GET_DATA_ALLOC (sec->sh_offset, aux.info_size, (char *) aux.info,
  			  char *, "unwind info");
  	}
      }
--- 3400,3406 ----
  	{
  	  aux.info_size = sec->sh_size;
  	  aux.info_addr = sec->sh_addr;
! 	  GET_DATA_ALLOC (sec->sh_offset, aux.info_size, aux.info,
  			  char *, "unwind info");
  	}
      }


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