refactor: Add [[nodiscard]] where ignoring a Result return type is an error #27774

pull maflcko wants to merge 2 commits into bitcoin:master from maflcko:2305-nodiscard-result-error- changing 7 files +14 −15
  1. maflcko commented at 11:36 am on May 29, 2023: member
    Only add it for those where it is an error to ignore. Also, fix the gcc compile warning #25977 (comment). Also, fix iwyu for touched header files.
  2. Add [[nodiscard]] where ignoring a Result return type is an error dddde27f6f
  3. fix includes for touched header files (iwyu) fa5680b752
  4. DrahtBot commented at 11:36 am on May 29, 2023: contributor

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK TheCharlatan, stickies-v

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #27711 (kernel: Remove shutdown from kernel library by TheCharlatan)

    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.

  5. DrahtBot renamed this:
    refactor: Add [[nodiscard]] where ignoring a Result return type is an error
    refactor: Add [[nodiscard]] where ignoring a Result return type is an error
    on May 29, 2023
  6. DrahtBot added the label Refactoring on May 29, 2023
  7. TheCharlatan commented at 1:02 pm on May 29, 2023: contributor

    Only add it for those where it is an error to ignore.

    How did you select these?

  8. maflcko commented at 1:08 pm on May 29, 2023: member

    How did you select these?

    I asked my brain if it thought that ignoring the return type would lead to errors in later code.

  9. TheCharlatan approved
  10. TheCharlatan commented at 1:45 pm on May 29, 2023: contributor
    ACK fa5680b7520c340952239c4e25ebe505d16c7c39
  11. stickies-v approved
  12. stickies-v commented at 2:12 pm on May 30, 2023: contributor

    ACK fa5680b7520c340952239c4e25ebe505d16c7c39

    I looked at all sites where Result is either of type void or some other descriptive/status type, and could not find any other places where the return value can never be ignored.

  13. stickies-v approved
  14. stickies-v commented at 2:12 pm on May 30, 2023: contributor
    (hit send twice - duplicate post)
  15. fanquake merged this on May 30, 2023
  16. fanquake closed this on May 30, 2023

  17. maflcko deleted the branch on May 30, 2023
  18. sidhujag referenced this in commit 4b69edba9b on May 30, 2023
  19. Fabcien referenced this in commit f3139ddbac on Dec 15, 2023
  20. bitcoin locked this on May 29, 2024

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-12-22 09:12 UTC

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