No description provided.
tidy: add readability-redundant-declaration #25047
pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:tidy_redundant_externs changing 3 files +12 −7-
fanquake commented at 11:06 AM on May 1, 2022: member
-
tidy: add readability-redundant-declaration c2b295881f
- DrahtBot added the label P2P on May 1, 2022
- vincenzopalazzo approved
-
vincenzopalazzo commented at 8:24 PM on May 3, 2022: none
-
jonatack commented at 11:52 PM on May 3, 2022: member
Review-only ACK c2b295881f852a9096c834334d6b84c988f579f5
See https://clang.llvm.org/extra/clang-tidy/checks/readability-redundant-declaration.html:
Finds redundant variable and function declarations. Such redundant declarations can be removed without changing program behavior. They can for instance be unintentional left overs from previous refactorings when code has been moved around. Having redundant declarations could in worst case mean that there are typos in the code that cause bugs.
Normally the code can be automatically fixed, clang-tidy can remove the second declaration. However there are 2 cases when you need to fix the code manually:
- When the declarations are in different header files;
- When multiple variables are declared together.
- MarcoFalke removed the label P2P on May 4, 2022
- MarcoFalke added the label Refactoring on May 4, 2022
-
MarcoFalke commented at 7:49 AM on May 4, 2022: member
Seems low benefit (would be hard to imagine this catches a real bug), but also low cost (would be hard to imagine this is hit more than once a year on a pull request), so it seems fine to merge.
- MarcoFalke merged this on May 4, 2022
- MarcoFalke closed this on May 4, 2022
- fanquake deleted the branch on May 4, 2022
- sidhujag referenced this in commit 00973a422f on May 4, 2022
- PastaPastaPasta referenced this in commit e7fa341082 on Oct 18, 2022
- DrahtBot locked this on May 4, 2023