This is the mail archive of the 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: [PATCH 1/2] objcopy: Factor out some of the option parsing code.

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)


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

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