Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Enable -Wredundant-decls where available. Remove redundant redeclarations. #13899

Merged
merged 3 commits into from Aug 13, 2018

Conversation

Projects
None yet
5 participants
@practicalswift
Copy link
Member

commented Aug 6, 2018

Remove redundant redeclaration of rescanblockchain and enable -Wredundant-decls (gcc) where available to avoid accidental redundant redeclarations.

 CXX      wallet/libbitcoin_wallet_a-rpcwallet.o
wallet/rpcwallet.cpp:4764:17: warning: redundant redeclaration of ‘UniValue rescanblockchain(const JSONRPCRequest&)’ in same scope [-Wredundant-decls]
 extern UniValue rescanblockchain(const JSONRPCRequest& request);
                 ^~~~~~~~~~~~~~~~
wallet/rpcwallet.cpp:3929:10: note: previous declaration of ‘UniValue rescanblockchain(const JSONRPCRequest&)’
 UniValue rescanblockchain(const JSONRPCRequest& request)
          ^~~~~~~~~~~~~~~~

@practicalswift practicalswift changed the title Remove redundant redeclarations. Enable -Wredundant-decls (gcc) where available. Remove redundant redeclarations. Enable -Wredundant-decls where available. Aug 6, 2018

@practicalswift practicalswift changed the title Remove redundant redeclarations. Enable -Wredundant-decls where available. build: Remove redundant redeclarations. Enable -Wredundant-decls where available. Aug 6, 2018

@practicalswift practicalswift changed the title build: Remove redundant redeclarations. Enable -Wredundant-decls where available. build: Enable -Wredundant-decls where available. Remove redundant redeclarations. Aug 6, 2018

@@ -4761,7 +4761,6 @@ extern UniValue importwallet(const JSONRPCRequest& request);
extern UniValue importprunedfunds(const JSONRPCRequest& request);
extern UniValue removeprunedfunds(const JSONRPCRequest& request);
extern UniValue importmulti(const JSONRPCRequest& request);

This comment has been minimized.

Copy link
@MarcoFalke

MarcoFalke Aug 6, 2018

Member

nit: Could remove the redundant extern as well, since you touch this block of code anyway.

@MarcoFalke

This comment has been minimized.

Copy link
Member

commented Aug 6, 2018

utACK f04bb13. Shouldn't hurt with the warning enabled.

@practicalswift

This comment has been minimized.

Copy link
Member Author

commented Aug 7, 2018

@MarcoFalke Redundant extern removed. Please re-review :-)

@ken2812221

This comment has been minimized.

Copy link
Member

commented Aug 7, 2018

utACK d56b73f

@Empact

This comment has been minimized.

Copy link
Member

commented Aug 7, 2018

utACK d56b73f could squash the first two

@fanquake

This comment has been minimized.

Copy link
Member

commented Aug 13, 2018

utACK d56b73f

Only tested compilation on macOS, but this shouldn't have an effect (using Clang) according to https://clang.llvm.org/docs/DiagnosticsReference.html#wredundant-decls.

@MarcoFalke MarcoFalke added this to the 0.18.0 milestone Aug 13, 2018

@MarcoFalke MarcoFalke merged commit d56b73f into bitcoin:master Aug 13, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

MarcoFalke added a commit that referenced this pull request Aug 13, 2018

Merge #13899: build: Enable -Wredundant-decls where available. Remove…
… redundant redeclarations.

d56b73f Remove redundant extern (practicalswift)
f04bb13 Enable -Wredundant-decls (gcc) if available (practicalswift)
a9e90e5 Remove redundant redeclaration of rescanblockchain(...) in same scope (practicalswift)

Pull request description:

  Remove redundant redeclaration of `rescanblockchain` and enable `-Wredundant-decls` (gcc) where available to avoid accidental redundant redeclarations.

  ```
   CXX      wallet/libbitcoin_wallet_a-rpcwallet.o
  wallet/rpcwallet.cpp:4764:17: warning: redundant redeclaration of ‘UniValue rescanblockchain(const JSONRPCRequest&)’ in same scope [-Wredundant-decls]
   extern UniValue rescanblockchain(const JSONRPCRequest& request);
                   ^~~~~~~~~~~~~~~~
  wallet/rpcwallet.cpp:3929:10: note: previous declaration of ‘UniValue rescanblockchain(const JSONRPCRequest&)’
   UniValue rescanblockchain(const JSONRPCRequest& request)
            ^~~~~~~~~~~~~~~~
  ```

Tree-SHA512: b9af95fa53f494c3f6702e485956b66b042d2ff7578b4a53bf28e91aa844cdcf5d7ac3e2e710948eed566007324e81317304b8eabf2d4ea284cd6acd77f8ffcd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.