This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] _bfd_ar_spacepad
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 8 Mar 2005 11:37:24 +1030
- Subject: Re: [PATCH] _bfd_ar_spacepad
- References: <20050307104753.GQ4777@sunsite.mff.cuni.cz>
On Mon, Mar 07, 2005 at 11:47:53AM +0100, Jakub Jelinek wrote:
> * libbfd-in.h (_bfd_ar_spacepad): New prototype.
> * libbfd.h: Rebuilt.
> * archive.c (_bfd_ar_spacepad): New function.
> (_bfd_construct_extended_name_table, _bfd_write_archive_contents,
> bsd_write_armap, _bfd_archive_bsd_update_armap_timestamp,
> coff_write_armap): Use it.
> (bfd_ar_hdr_from_filesystem): Likewise. Fix HP-UX large
> uid/gid support.
> * archive64.c (bfd_elf64_archive_write_armap): Use _bfd_ar_spacepad.
I like it.
> + _bfd_ar_spacepad (hdr->ar_name + 1, maxname - 1, "%-ld",
> + (unsigned) (strptr - *tabloc));
Remove the cast here, or make it (unsigned long). Seeing "%ld" and
(unsigned) just looks wrong when scanning the code.
> + _bfd_ar_spacepad (hdr.ar_size, sizeof (hdr.ar_size), "%-10ld",
> + (int) ((elength + 1) & ~(bfd_size_type) 1));
Similarly, use (long) here or remove the cast.
> + _bfd_ar_spacepad (hdr.ar_size, sizeof (hdr.ar_size), "%-10ld", (int) mapsize);
Likewise. Also in archive64.c.
--
Alan Modra
IBM OzLabs - Linux Technology Centre