Skip to content

Conversation

@fanquake
Copy link
Member

@fanquake fanquake commented May 1, 2022

No description provided.

@DrahtBot DrahtBot added the P2P label May 1, 2022
Copy link

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK c2b2958

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review-only ACK c2b2958

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.

@maflcko maflcko added Refactoring and removed P2P labels May 4, 2022
@maflcko
Copy link
Member

maflcko commented May 4, 2022

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.

@maflcko maflcko merged commit 880cec9 into bitcoin:master May 4, 2022
@fanquake fanquake deleted the tidy_redundant_externs branch May 4, 2022 07:56
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request May 4, 2022
c2b2958 tidy: add readability-redundant-declaration (fanquake)

Pull request description:

ACKs for top commit:
  vincenzopalazzo:
    ACK bitcoin@c2b2958
  jonatack:
    Review-only ACK c2b2958

Tree-SHA512: 992dd81f9d0c511efcd8d9d1a8c05fc1401b854272f28f7f31ca0922164ddd7d7c01bfcf5ca268472b5d68969137110f5c0844a52938d294750584e1a948a874
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 18, 2022
c2b2958 tidy: add readability-redundant-declaration (fanquake)

Pull request description:

ACKs for top commit:
  vincenzopalazzo:
    ACK bitcoin@c2b2958
  jonatack:
    Review-only ACK c2b2958

Tree-SHA512: 992dd81f9d0c511efcd8d9d1a8c05fc1401b854272f28f7f31ca0922164ddd7d7c01bfcf5ca268472b5d68969137110f5c0844a52938d294750584e1a948a874
@bitcoin bitcoin locked and limited conversation to collaborators May 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants