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
  1. fanquake commented at 11:06 AM on May 1, 2022: member

    No description provided.

  2. tidy: add readability-redundant-declaration c2b295881f
  3. DrahtBot added the label P2P on May 1, 2022
  4. vincenzopalazzo approved
  5. 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.
  6. MarcoFalke removed the label P2P on May 4, 2022
  7. MarcoFalke added the label Refactoring on May 4, 2022
  8. 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.

  9. MarcoFalke merged this on May 4, 2022
  10. MarcoFalke closed this on May 4, 2022

  11. fanquake deleted the branch on May 4, 2022
  12. sidhujag referenced this in commit 00973a422f on May 4, 2022
  13. PastaPastaPasta referenced this in commit e7fa341082 on Oct 18, 2022
  14. DrahtBot locked this on May 4, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-22 06:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me