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. > Is it OK for trunk? > > > Thanks > Bernd. > > > > patch-wshadow-elfos.diff > > 2019-10-04 Bernd Edlinger <bernd.edlin...@hotmail.de> > > * config/elfos.h (ASM_DECLARE_OBJECT_NAME, > ASM_FINISH_DECLARE_OBJECT): Rename local vars in macro. 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 the macro is used.
Convert to real functions. It avoids the shadowing problem and avoids macros touching/referencing things they shouldn't. Code in macros may have been reasonable in the 80s/90s, but we should know better by now. I'm not ranting against you Bernd, it's more a rant against the original coding style for GCC. Your changes just highlight how bad of an idea this kind of macro usage really is. We should take the opportunity to fix this stuff for real. JEff