This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 1/2] objcopy: Factor out some of the option parsing code.
- From: Steve Ellcey <sellcey at imgtec dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>
- Cc: <binutils at sourceware dot org>
- Date: Thu, 26 Feb 2015 08:51:41 -0800
- Subject: Re: [PATCH 1/2] objcopy: Factor out some of the option parsing code.
- Authentication-results: sourceware.org; auth=none
- References: <175d62402c134c5961a0758844c8262e43e43fc6 dot 1424695434 dot git dot andrew dot burgess at embecosm dot com>
- Reply-to: <sellcey at imgtec dot com>
On Mon, 2015-02-23 at 12:52 +0000, Andrew Burgess wrote:
> This patch splits out some of the option parsing code, increasing code
> reuse.
>
> binutils/ChangeLog:
>
> * objcopy.c (init_section_add): New function.
> (section_add_load_file): New function.
> (copy_main): Make use of new functions.
> +static struct section_add *
> +init_section_add (const char *optarg,
> + struct section_add *next,
> + const char *option)
Andrew,
This change is breaking the binutils build for me. The build dies with:
/scratch/sellcey/repos/objcopy/src/binutils/binutils/objcopy.c: In function 'init_section_add':
/scratch/sellcey/repos/objcopy/src/binutils/binutils/objcopy.c:3556:31: error: declaration of 'optarg' shadows a global declaration [-Werror=shadow]
cc1: all warnings being treated as errors
optarg is defined as a global variable in include/getopt.h in the binutils
sources. Could you rename the optarg argument to something else? I am not
sure if other people are seeing this or not, I am building binutils on ubuntu 12.04
with GCC 4.6.3.
Steve Ellcey
sellcey@imgtec.com