On 10/4/19 12:24 PM, Bernd Edlinger wrote: > Hi, > > this macro caused -Wshadow=local warnings in varasm.c with > the microblaze target. > > > Only built a bare metal cross compiler that was able to compile > libgcc for that target. > > Is it OK for trunk? > > > Thanks > Bernd. > > > > patch-wshadow-defaults.diff > > 2019-10-04 Bernd Edlinger <bernd.edlin...@hotmail.de> > > * defaults.h (ASM_OUTPUT_ASCII): Rename local vars in macro. > Remove variable hiding code. ISTM this would be better done by creating a target hook with the defaults.h implementation as the default implementation and converting the dozen or so backends that need to override the default.
More generally, shadowing problems are inherent with macro usage and I suspect pervasive due to the original GCC style of writing far too much code in macros. Rather then burning a lot of time renaming variables, which still have shadowing potential that we should be turning all the macro crap into real functions. Jeff