rpc: Adjust ifdef to avoid unreachable code #12787

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:unreachable-code-ifdef-ENABLE_WALLET changing 1 files +6 −6
  1. practicalswift commented at 9:31 AM on March 26, 2018: contributor

    Adjust ifdef to avoid unreachable code.

    Introduced in 1e79c055cd30d21ba5f8c7f81ef911d5d4e295a8.

  2. fanquake added the label RPC/REST/ZMQ on Mar 26, 2018
  3. MarcoFalke commented at 1:01 PM on March 26, 2018: member

    You could avoid the "guards cross scopes" by moving everything into the else-scope:

    }else{
        // ...
        #ifdef ...
        return ...wallet
        #endif
        throw
    }
    

    Also, would be nice if you added a test for the failure case to wallet_disable.py

  4. MarcoFalke added the label Refactoring on Mar 26, 2018
  5. MarcoFalke commented at 1:02 PM on March 26, 2018: member

    Assigning "refactoring", since it shouldn't change behavior.

  6. rpc: Adjust ifdef to avoid unreachable code 61f82981b2
  7. practicalswift force-pushed on Mar 26, 2018
  8. achow101 commented at 3:18 PM on March 26, 2018: member

    utACK 61f82981b2e12866520a5eceada4bf759754f827

    Travis seems to have timed out so I restarted it.

  9. MarcoFalke commented at 5:14 PM on March 26, 2018: member

    utACK 61f82981b2e12866520a5eceada4bf759754f827

  10. sipa commented at 5:35 PM on March 26, 2018: member

    utACK 61f82981b2e12866520a5eceada4bf759754f827

  11. promag commented at 5:49 PM on March 26, 2018: member

    avoid unreachable code

    What unreachable code?

  12. MarcoFalke commented at 5:52 PM on March 26, 2018: member

    I'd assume it is a static analyser warning that in return; throw; the throw is unreachable.

  13. promag commented at 6:42 PM on March 26, 2018: member

    utACK 61f8298.

  14. jnewbery commented at 4:20 PM on March 28, 2018: member

    This code is all disappearing after V0.17 is branched, but fine, utACK 61f82981b2e12866520a5eceada4bf759754f827

  15. laanwj merged this on Mar 29, 2018
  16. laanwj closed this on Mar 29, 2018

  17. laanwj referenced this in commit cd99e5bdc8 on Mar 29, 2018
  18. Fabcien referenced this in commit fa8d487a9f on Aug 30, 2019
  19. PastaPastaPasta referenced this in commit 97260e84b0 on Dec 16, 2020
  20. PastaPastaPasta referenced this in commit ac06e2c4b7 on Dec 18, 2020
  21. practicalswift deleted the branch on Apr 10, 2021
  22. gades referenced this in commit 7f58e861ba on Mar 22, 2022
  23. DrahtBot locked this on Aug 16, 2022

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-13 15:15 UTC

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