fuzz: fix unused variable compiler warning in addrdb #19551

pull jonatack wants to merge 1 commits into bitcoin:master from jonatack:fix-unused-variable-in-addrdb-fuzzer changing 1 files +2 −0
  1. jonatack commented at 5:18 AM on July 19, 2020: member

    Fixes #19549

  2. fanquake added the label Tests on Jul 19, 2020
  3. in src/test/fuzz/addrdb.cpp:21 in 8f70074458 outdated
      16 | @@ -17,6 +17,8 @@ void test_one_input(const std::vector<uint8_t>& buffer)
      17 |  {
      18 |      FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
      19 |  
      20 | +    // `ban_entry` is no longer used, but the harness still needs to consume the
      21 | +    // same data that it did previously to not invalidate existing seeds.
    


    MarcoFalke commented at 5:57 AM on July 19, 2020:

    Maybe comment here "The point of the code is to exercise all CBanEntry ctors :)" from #19549 (comment)

  4. in src/test/fuzz/addrdb.cpp:37 in 8f70074458 outdated
      33 | @@ -32,4 +34,5 @@ void test_one_input(const std::vector<uint8_t>& buffer)
      34 |          }
      35 |          return CBanEntry{};
      36 |      }();
      37 | +    (void)ban_entry;
    


    MarcoFalke commented at 5:57 AM on July 19, 2020:

    and then comment this as

        (void)ban_entry; // currently unused
    
  5. MarcoFalke approved
  6. MarcoFalke commented at 5:59 AM on July 19, 2020: member

    The rationale "not invalidate existing seeds" is a nice-to-have, not a strict rule. I think it is enough to say that the constructors should be exercised, but the entry itself is currently unused.

  7. MarcoFalke commented at 6:00 AM on July 19, 2020: member

    ACK either way

    cc @practicalswift

  8. fuzz: fix unused variable addrdb compiler warning 1cdc2a642b
  9. jonatack force-pushed on Jul 19, 2020
  10. jonatack commented at 6:33 AM on July 19, 2020: member

    Thank @MarcoFalke, updated with your feedback.

  11. MarcoFalke commented at 6:34 AM on July 19, 2020: member

    review re-ACK 1cdc2a642b8b5dab7a830b5d7262add5363400db

  12. hebasto approved
  13. hebasto commented at 6:51 AM on July 19, 2020: member

    ACK 1cdc2a642b8b5dab7a830b5d7262add5363400db, tested on Linux Mint 20 (x86_64, clang 10.0).

  14. practicalswift commented at 7:31 AM on July 19, 2020: contributor

    ACK 1cdc2a642b8b5dab7a830b5d7262add5363400db

    Thanks for fixing :)

  15. fanquake merged this on Jul 19, 2020
  16. fanquake closed this on Jul 19, 2020

  17. jonatack deleted the branch on Jul 19, 2020
  18. 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: 2026-04-14 21:14 UTC

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