I am playing with GCC's warnings, and I haven't been able to figure out how to suppress some of them.
The most annoying warning I enabled is with -Wshadow.
https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.htmlI learned this pattern:
Person::Person(string name)
{
this->name = name;
My shadowing in the constructor is intentional. I do this a lot. Is there a way to suppress the warning:
declaration of ‘name’ shadows a member of ‘Person’
on a case by case basis? Maybe with a macro? How do you guys do it?
I know a lot of people would do something like
this->myName = name
but I find the extra 'my' cringy. I don't know why I don't like it. I just don't.