[doc] dev-notes: Members should be initialized #12434

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:Mf1802-docDevMemberInit changing 2 files +14 −12
  1. MarcoFalke commented at 9:45 PM on February 14, 2018: member

    Also, remove mention of threads that were removed long ago.

    Motivation: Make it easier to spot bugs such as #11654 and #12426

  2. MarcoFalke added the label Docs on Feb 14, 2018
  3. practicalswift commented at 10:21 PM on February 14, 2018: contributor

    ACK fa03f777880cbe245676a3ac4d5b22d2bc93dbe9

  4. dcousens approved
  5. promag commented at 11:29 PM on February 14, 2018: member

    ACK fa03f77.

  6. [doc] dev-notes: Members should be initialized
    Also, remove mention of threads that were removed long ago
    fa94614738
  7. in doc/developer-notes.md:385 in fa03f77788 outdated
     380 | +
     381 | +  - *Rationale*: Initializing the members in the declaration makes it easy to spot uninitialized ones,
     382 | +  and avoids accidentally reading uninitialized memory
     383 | +
     384 | +```cpp
     385 | +struct A {
    


    laanwj commented at 8:43 AM on February 15, 2018:

    You're talking about class members above, but using a struct here. I think there can be good (performance) arguments not to have an auto-generated constructor for a POD struct, so might be better to use a class for illustration.


    MarcoFalke commented at 7:23 PM on February 16, 2018:

    My opinion is that such cases should just be justified with a comment:

    int a; // Not initialized for performance reasons.
    

    MarcoFalke commented at 3:43 PM on February 25, 2018:

    Anyway, fixed...

  8. MarcoFalke force-pushed on Feb 16, 2018
  9. fanquake commented at 4:39 PM on March 5, 2018: member

    utACK fa94614

  10. laanwj merged this on Mar 5, 2018
  11. laanwj closed this on Mar 5, 2018

  12. laanwj referenced this in commit 21e2670de3 on Mar 5, 2018
  13. MarcoFalke deleted the branch on Mar 19, 2018
  14. PastaPastaPasta referenced this in commit 45beb63cf2 on Jun 10, 2020
  15. PastaPastaPasta referenced this in commit 967a681da8 on Jun 12, 2020
  16. PastaPastaPasta referenced this in commit b541a28a74 on Jun 13, 2020
  17. PastaPastaPasta referenced this in commit 7e8d72c862 on Jun 14, 2020
  18. PastaPastaPasta referenced this in commit 28879fc052 on Jun 14, 2020
  19. MarcoFalke locked this on Sep 8, 2021

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-17 06:15 UTC

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