Test and enabled -Wshadow by default, add developer note about this change (see #8105).
As my native language is not English, I'm open to suggestions.
[Edits from maintainers allowed for easier cooperation.]
Test and enabled -Wshadow by default, add developer note about this change (see #8105).
As my native language is not English, I'm open to suggestions.
[Edits from maintainers allowed for easier cooperation.]
330 | @@ -331,6 +331,31 @@ Strings and formatting 331 | 332 | - *Rationale*: Bitcoin Core uses tinyformat, which is type safe. Leave them out to avoid confusion 333 | 334 | +Variable names 335 | +-------------- 336 | + 337 | +The shadowing warning (`-Wshadow`) is enabled by default. Please name
Done in the squashme commit.
Concept ACK
utACK. At this moment, though, this still generates 3406 warnings in the process of the build:
$ grep Wshadow /tmp/log|wc
3406 30643 458032
I don't think this number needs to be 0 before merging this, but it does needs to be a manageable number to avoid 'shadowing' other warnings and errors, as well as increasing the Travis output by a thousandfold.
Definitely. This has to wait.
There are other PRs open, serialization changes has to be merged, and I still have to PR txmempool, main, wallet, torcontroller and tests changes.
I'd say most urgent is to remove shadowing in (inline code in) header files, especially the often-included ones. Those warnings come back for every compiled file.
The univalue upstream merge (#8807) brought the total number of warnings here down to 3197.
Current master w/ clang 3.9.0, full build (including GUI). No extra PRs applied.
@laanwj Can you upload the build log after grep "warning: declaration shadows" somewhere for me? Or at least present something like ... | sort | uniq -c | sort -rn | head ;-)
@paveljanik Sure: https://dev.visucore.com/bitcoin/tmp/log.gz
I think what is left is nearly all serialization related, certainly the ones that appear many times.
Great - this means there are 42 unique instances of this warning. Getting closer to zero :-)
Concept ACK. Optimistically tagging this for 0.14.0
@fanquake Thanks for testing, Michael!
Since the two pulls got merged, anything holding this back besides maybe #8808?
Yes, thanks for testing @fanquake. I can confirm the same with LLVM 4.0 (git master, empty ccache) on Linux.
As #9039 is merged this is ready for merge after the squashme is squashed (done).
#8808 and the shadow warning in leveldb doesn't need to be a blocker, the reason for holding this off was the warning spam for every single file and that's gone now.
Will also try this with gcc just to be sure (done).
Thanks everyone for testing!
Going to revert this, even though I tested this with two compilers before merging, people on IRC are apperently noticing floods of Wshadow warnings.
Milestone
0.14.0