[[nodiscard]]
to avoid issues like the one fixed in #21631.
net: flag relevant Sock methods with [[nodiscard]] #21659
pull vasild wants to merge 1 commits into bitcoin:master from vasild:Sock_nodiscard changing 4 files +21 −18-
vasild commented at 1:51 pm on April 12, 2021: memberFlag relevant Sock methods with
-
vasild commented at 1:58 pm on April 12, 2021: member
Having two
Wait()
methods - one flagged with[[nodiscard]]
with 3 arguments and one without[[nodiscard]]
with 2 arguments seems like too much new lines of code.I am ~0 on this. Taking the dump/KISS approach for now - one
[[nodiscard]] Wait()
and cast tovoid
the callers that don’t check the return value. -
practicalswift commented at 2:19 pm on April 12, 2021: contributor
Concept ACK
Rationale: Having the
[[nodiscard]]
annotation onWait
would have saved us from one uninitialized read historically. That’s enough empirical evidence to convince me about the need for[[nodiscard]]
here.Thanks for addressing this!
-
DrahtBot added the label P2P on Apr 12, 2021
-
DrahtBot added the label Utils/log/libs on Apr 12, 2021
-
fanquake added the label Needs rebase on Apr 13, 2021
-
net: flag relevant Sock methods with [[nodiscard]] e286cd0d7b
-
vasild force-pushed on Apr 13, 2021
-
vasild marked this as ready for review on Apr 13, 2021
-
DrahtBot removed the label Needs rebase on Apr 13, 2021
-
practicalswift commented at 6:29 am on April 14, 2021: contributorcr ACK e286cd0d7b4e12c8efe5e7ac3066a100e0ba2c0a: the only changes made are additions of
[[nodiscard]]
and(void)
where appropriate -
DrahtBot commented at 11:28 pm on May 7, 2021: 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:
- #21878 (Make all networking code mockable by vasild)
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.
-
laanwj commented at 1:08 pm on May 19, 2021: memberCode review ACK e286cd0d7b4e12c8efe5e7ac3066a100e0ba2c0a
-
laanwj merged this on May 19, 2021
-
laanwj closed this on May 19, 2021
-
vasild deleted the branch on May 19, 2021
-
sidhujag referenced this in commit 6ae83253d2 on May 19, 2021
-
gwillen referenced this in commit ba0573cbe6 on Jun 1, 2022
-
DrahtBot locked this on Aug 18, 2022
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-19 03:12 UTC
More mirrored repositories can be found on mirror.b10c.me