This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] Fix -Wshadow=local warnings in defaults.h


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.edlinger@hotmail.de>
> 
> 	* defaults.h (ASM_OUTPUT_ASCII): Rename local vars in macro.
> 	Remove variable hiding code.
For the record, I really dislike blindly prefixing or suffixing
variables with numbers or underscores to avoid shadow warnings.  IMHO
it's not a significant improvement in terms of readability.

Just to be clear, I'm absolutely for fixing our shadowing problems, but
I'm not sure the way we're going about it is actually a significant
improvement.

jeff


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