fuzz: Avoid designated initialization (C++20) in fuzz tests #21037

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:c++20-false-start changing 1 files +2 −2
  1. practicalswift commented at 8:27 AM on January 30, 2021: contributor

    Avoid designated initialization (C++20) in fuzz tests.

    Context: #20197 (review), #20936 (review)

  2. fuzz: Avoid designated initialization (C++20) in fuzz tests dee2d6fbf9
  3. fanquake added the label Tests on Jan 30, 2021
  4. MarcoFalke commented at 8:37 AM on January 30, 2021: member

    cr ACK dee2d6fbf9008d0e0667b3744d847192be6ef6e0

  5. dhruv commented at 10:42 PM on January 30, 2021: member

    code review ACK dee2d6fbf9008d0e0667b3744d847192be6ef6e0

  6. ajtowns commented at 7:03 AM on January 31, 2021: member

    utACK dee2d6fbf9008d0e0667b3744d847192be6ef6e0

    If you wanted to preserve the constness, could do something like the designated initializers via:

    #define DES_INIT_VIA_x(TYP, CODE)     (([&]() { TYP x; {CODE} return x; })())
    
    const in_addr v4_addr = DES_INIT_VIA_x(in_addr,
            x.s_addr = fuzzed_data_provider.ConsumeIntegral<uint32_t>();
    );
    
  7. MarcoFalke merged this on Jan 31, 2021
  8. MarcoFalke closed this on Jan 31, 2021

  9. sidhujag referenced this in commit ab208da4d8 on Feb 2, 2021
  10. practicalswift deleted the branch on Apr 10, 2021
  11. PastaPastaPasta referenced this in commit a83e04a6b0 on Jul 17, 2022
  12. DrahtBot locked this on Aug 16, 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-04-16 15:14 UTC

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