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: member

    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:

    0src/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: member

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

    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. MarcoFalke commented at 9:07 am on November 30, 2020: member

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

  10. 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 :)
  11. fjahr force-pushed on Dec 1, 2020
  12. fjahr commented at 1:12 am on December 1, 2020: member

    @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.

  13. DrahtBot added the label Needs rebase on Dec 1, 2020
  14. lint: Use c++17 std in cppcheck linter c502a6dbfb
  15. refactor: Improve use of explicit keyword 1e62350ca2
  16. fjahr force-pushed on Dec 1, 2020
  17. DrahtBot removed the label Needs rebase on Dec 1, 2020
  18. fanquake removed the label GUI on Dec 2, 2020
  19. fanquake removed the label Mempool on Dec 2, 2020
  20. fanquake removed the label P2P on Dec 2, 2020
  21. fanquake removed the label RPC/REST/ZMQ on Dec 2, 2020
  22. fanquake removed the label Validation on Dec 2, 2020
  23. fanquake removed the label Wallet on Dec 2, 2020
  24. fanquake added the label Refactoring on Dec 2, 2020
  25. fanquake added the label Scripts and tools on Dec 2, 2020
  26. fanquake requested review from practicalswift on Dec 2, 2020
  27. 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

  28. MarcoFalke commented at 10:55 am on December 2, 2020: member
    review ACK 1e62350ca20898189904a88dfef9ea11ddcd8626
  29. fanquake merged this on Dec 2, 2020
  30. fanquake closed this on Dec 2, 2020

  31. sidhujag referenced this in commit be66fe3b7f on Dec 2, 2020
  32. DrahtBot 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: 2024-11-17 06:12 UTC

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