Re: [PATCH] Fix -Wshadow=local warnings in elfos.h

2019-10-13 Thread Jeff Law
On 10/5/19 12:16 AM, Bernd Edlinger wrote: > > > On 10/4/19 10:26 PM, Jeff Law wrote: >> On 10/4/19 12:24 PM, Bernd Edlinger wrote: >>> Hi, >>> >>> these macros don't use reserved names for local variables. >>> This caused -Wshadow=local warnings in varasm.c IIRC. >>> >>> Fixed by using _lowercas

Re: [PATCH] Fix -Wshadow=local warnings in elfos.h

2019-10-07 Thread Joseph Myers
On Sat, 5 Oct 2019, Bernd Edlinger wrote: > > Like > > > > #define DEFAULT_SOME_MACRO(PARMS) { lots of code } > > > > becomes > > > > #define DEFAULT_SOME_MACRO(PARMS) default_some_macro(PARMS) > > > > static inline int > > default_some_macro (int parm, long another) > > { > > lots of code;

Re: [PATCH] Fix -Wshadow=local warnings in elfos.h

2019-10-05 Thread Segher Boessenkool
On Sat, Oct 05, 2019 at 08:28:26AM +, Bernd Edlinger wrote: > On 10/5/19 9:26 AM, Segher Boessenkool wrote: > > On Fri, Oct 04, 2019 at 02:26:26PM -0600, Jeff Law wrote: > > To get 95% of the benefit for only 2% of the pain, you can make an inline > > function where there was a macro before, an

Re: [PATCH] Fix -Wshadow=local warnings in elfos.h

2019-10-05 Thread Bernd Edlinger
On 10/5/19 9:26 AM, Segher Boessenkool wrote: > On Fri, Oct 04, 2019 at 02:26:26PM -0600, Jeff Law wrote: >> Same objections as before. As long as we're using macros like this, >> we're going to have increased potential for shadowing problems and >> macros which touch implementation details that j

Re: [PATCH] Fix -Wshadow=local warnings in elfos.h

2019-10-05 Thread Segher Boessenkool
On Fri, Oct 04, 2019 at 02:26:26PM -0600, Jeff Law wrote: > Same objections as before. As long as we're using macros like this, > we're going to have increased potential for shadowing problems and > macros which touch implementation details that just happen to be > available in the context where t

Re: [PATCH] Fix -Wshadow=local warnings in elfos.h

2019-10-04 Thread Bernd Edlinger
On 10/4/19 10:26 PM, Jeff Law wrote: > On 10/4/19 12:24 PM, Bernd Edlinger wrote: >> Hi, >> >> these macros don't use reserved names for local variables. >> This caused -Wshadow=local warnings in varasm.c IIRC. >> >> Fixed by using _lowercase reserved names for macro parameters. >> >> >> Bootstr

Re: [PATCH] Fix -Wshadow=local warnings in elfos.h

2019-10-04 Thread Jeff Law
On 10/4/19 12:24 PM, Bernd Edlinger wrote: > Hi, > > these macros don't use reserved names for local variables. > This caused -Wshadow=local warnings in varasm.c IIRC. > > Fixed by using _lowercase reserved names for macro parameters. > > > Bootstrapped and reg-tested on x86_64-pc-linux-gnu. >

[PATCH] Fix -Wshadow=local warnings in elfos.h

2019-10-04 Thread Bernd Edlinger
Hi, these macros don't use reserved names for local variables. This caused -Wshadow=local warnings in varasm.c IIRC. Fixed by using _lowercase reserved names for macro parameters. Bootstrapped and reg-tested on x86_64-pc-linux-gnu. Is it OK for trunk? Thanks Bernd. 2019-10-04 Bernd Edlinge