lint, refactor: Update cppcheck linter to c++17 and improve explicit usage #20530

pull fjahr wants to merge 2 commits into bitcoin:master from fjahr:cppcheck17 changing 19 files +32 −23
  1. fjahr commented at 6:36 PM on November 29, 2020: contributor

    I found the extended-lint-cppcheck linter still uses std=c++11 when reviewing #20471. The only difference in the output after this change is one line is missing:

    src/script/descriptor.cpp:159:5: warning: Struct 'PubkeyProvider' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
    

    After some digging, I am still not sure why this one is ignored with c++17 when 40 othernoExplicitConstructor warnings were still appearing.

    In the second commit, I fix these warnings, adding explicit where appropriate and adding fixes to ignore otherwise.

  2. DrahtBot added the label GUI on Nov 29, 2020
  3. DrahtBot added the label Mempool on Nov 29, 2020
  4. DrahtBot added the label P2P on Nov 29, 2020
  5. DrahtBot added the label RPC/REST/ZMQ on Nov 29, 2020
  6. DrahtBot added the label Validation on Nov 29, 2020
  7. DrahtBot added the label Wallet on Nov 29, 2020
  8. DrahtBot commented at 2:09 AM on November 30, 2020: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #19910 (net processing: Move peer_map to PeerManager by jnewbery)
    • #19461 (multiprocess: Add bitcoin-gui -ipcconnect option by ryanofsky)
    • #19460 (multiprocess: Add bitcoin-wallet -ipcconnect option by ryanofsky)
    • #18261 (Erlay: bandwidth-efficient transaction relay protocol by naumenkogs)
    • #18017 (txmempool: split epoch logic into class by ajtowns)
    • #10102 ([experimental] Multiprocess bitcoin by ryanofsky)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  9. DrahtBot cross-referenced this on Nov 30, 2020 from issue refactor: Move node and wallet code out of src/interfaces by ryanofsky
  10. DrahtBot cross-referenced this on Nov 30, 2020 from issue net processing: Move peer_map to PeerManager by jnewbery
  11. DrahtBot cross-referenced this on Nov 30, 2020 from issue multiprocess: Add bitcoin-gui -ipcconnect option by ryanofsky
  12. DrahtBot cross-referenced this on Nov 30, 2020 from issue multiprocess: Add bitcoin-wallet -ipcconnect option by ryanofsky
  13. DrahtBot cross-referenced this on Nov 30, 2020 from issue multiprocess: Add basic spawn and IPC support by ryanofsky
  14. MarcoFalke commented at 9:07 AM on November 30, 2020: member

    <!--4a62be1de6b64f3ed646cdc7932c8cf5-->

    🕵️ @sipa @practicalswift @achow101 have been requested to review this pull request as specified in the {FILENAME_REVIEWERS} file.

  15. MarcoFalke cross-referenced this on Nov 30, 2020 from issue doc: rename CODEOWNERS to REVIEWERS by adamjonas
  16. practicalswift commented at 2:26 PM on November 30, 2020: contributor

    Concept ACK: explicit is better than implicit generally, and to be explicit: especially when it comes to explicit ctors @fjahr Looks like the fuzzing harnesses needs some massage to compile properly after your fix :)

  17. DrahtBot cross-referenced this on Nov 30, 2020 from issue Erlay: bandwidth-efficient transaction relay protocol by naumenkogs
  18. DrahtBot cross-referenced this on Nov 30, 2020 from issue txmempool: split epoch logic into class by ajtowns
  19. DrahtBot cross-referenced this on Nov 30, 2020 from issue Multiprocess bitcoin by ryanofsky
  20. fjahr force-pushed on Dec 1, 2020
  21. fjahr commented at 1:12 AM on December 1, 2020: contributor

    @fjahr Looks like the fuzzing harnesses needs some massage to compile properly after your fix :)

    Thanks, forgot to do that before pushing. Should be ok now.

  22. DrahtBot added the label Needs rebase on Dec 1, 2020
  23. lint: Use c++17 std in cppcheck linter c502a6dbfb
  24. refactor: Improve use of explicit keyword 1e62350ca2
  25. fjahr force-pushed on Dec 1, 2020
  26. DrahtBot removed the label Needs rebase on Dec 1, 2020
  27. fanquake removed the label GUI on Dec 2, 2020
  28. fanquake removed the label Mempool on Dec 2, 2020
  29. fanquake removed the label P2P on Dec 2, 2020
  30. fanquake removed the label RPC/REST/ZMQ on Dec 2, 2020
  31. fanquake removed the label Validation on Dec 2, 2020
  32. fanquake removed the label Wallet on Dec 2, 2020
  33. fanquake added the label Refactoring on Dec 2, 2020
  34. fanquake added the label Scripts and tools on Dec 2, 2020
  35. fanquake requested review from practicalswift on Dec 2, 2020
  36. practicalswift commented at 10:28 AM on December 2, 2020: contributor

    cr ACK 1e62350ca20898189904a88dfef9ea11ddcd8626: patch looks correct!

    Rationale behind Concept ACK from C++ Core Guidelines: By default, declare single-argument constructors explicit

  37. MarcoFalke commented at 10:55 AM on December 2, 2020: member

    review ACK 1e62350ca20898189904a88dfef9ea11ddcd8626

  38. fanquake merged this on Dec 2, 2020
  39. fanquake closed this on Dec 2, 2020

  40. sidhujag referenced this in commit be66fe3b7f on Dec 2, 2020
  41. bitcoin locked this on Feb 15, 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-05-20 06:54 UTC