Fix shadowing of 'what' as described in #10080.#10089
Fix shadowing of 'what' as described in #10080.#10089dooglus wants to merge 1 commit intobitcoin:masterfrom
Conversation
|
Duplicate of #10087. |
|
Closing mine, as @dooglus was original reporter. Thanks! |
|
ACK c8b6cc7 |
|
I'm seeing a lot of very similar warnings when building the Qt client: I don't remember seeing them previously (like on the 0.14 branch). What is causing all this 'shadowing' all of a sudden? |
|
We turned on |
|
Well that explains it then! I'm happy to fix these warnings if there's an acceptable way of coming up with alternative non-shadowing argument names. You didn't like my underscore, and I don't know how you came up with your suggested replacement name. |
Yes, ever since enabling them (and before that) there has been a huge discussion about this. See also my comment here: #9911 (comment) Unlike in C, for C++ the concept of shadowing seems to be somewhat subjective per compiler vendor and version. So if the source code is clear in clang, it may still cough up tons of warnings in g++. Older versions of g++ tend to go over the top to emit as many warnings as possible. We cannot and should not fix all shadowing warnings for all compilers. Maybe it would make sense to disable the warning for some older gccs. |
|
NACK. Let's disable wshadow on oder gcc versions. |
|
Closing this. Let's continue discussion about disabling -wshadow / fixing older versions in #10080. |
This warning was enabled by default in bitcoin#8808 but it's a [continuing](bitcoin#9911 (comment)) [source](bitcoin#10089 (comment)) of [annoyance](bitcoin#9911 (comment)) for me and other developers. I'm sick of sounding like a broken record, so disable it again.
@paveljanik is this what you meant? I didn't really understand your request.