test: Fix fuzzer compilation on macOS #19562

pull freenancial wants to merge 1 commits into bitcoin:master from freenancial:fix-fuzzer-macos changing 1 files +2 −2
  1. freenancial commented at 10:25 PM on July 21, 2020: contributor

    fixes #19557

    Before the fix:

    ➜  bitcoin git:(fix-fuzzer-macos) make
    Making all in src
      CXX      test/fuzz/addition_overflow-addition_overflow.o
    In file included from test/fuzz/addition_overflow.cpp:7:
    ./test/fuzz/util.h:335:13: error: no matching function for call to 'AdditionOverflow'
            if (AdditionOverflow((uint64_t)fuzzed_file->m_offset, random_bytes.size())) {
                ^~~~~~~~~~~~~~~~
    ./test/fuzz/util.h:201:16: note: candidate template ignored: deduced conflicting types for parameter 'T' ('unsigned long long' vs. 'unsigned long')
    NODISCARD bool AdditionOverflow(const T i, const T j) noexcept
                   ^
    ./test/fuzz/util.h:346:13: error: no matching function for call to 'AdditionOverflow'
            if (AdditionOverflow(fuzzed_file->m_offset, n)) {
                ^~~~~~~~~~~~~~~~
    ./test/fuzz/util.h:201:16: note: candidate template ignored: deduced conflicting types for parameter 'T' ('long long' vs. 'long')
    NODISCARD bool AdditionOverflow(const T i, const T j) noexcept
                   ^
    

    After the fix:

    ➜  bitcoin git:(fix-fuzzer-macos) ./configure --enable-fuzz --with-sanitizers=fuzzer,address,undefined CC=/usr/local/opt/llvm/bin/clang CXX=/usr/local/opt/llvm/bin/clang++ --disable-asm && make clean && make -j5
    ...
    ...
      CXXLD    test/fuzz/uint256_deserialize
    Making all in doc/man
    make[1]: Nothing to be done for `all'.
    make[1]: Nothing to be done for `all-am'.
    
  2. test: Fix fuzzer compilation on macOS
    fixes #19557
    c8992e8959
  3. freenancial commented at 10:28 PM on July 21, 2020: contributor

    This PR is following the advice of @practicalswift here: #19557 (comment)

  4. DrahtBot added the label Tests on Jul 21, 2020
  5. MarcoFalke commented at 5:45 AM on July 22, 2020: member

    review ACK c8992e89594a54edf283e4916f794475070b5114

  6. fanquake approved
  7. fanquake commented at 9:58 AM on July 22, 2020: member

    ACK c8992e89594a54edf283e4916f794475070b5114 - tested that compiling works on macOS.

    In future, if you're cherry-picking / contributing somebody else's patch, adding a Co-authored-by: other contributor is appreciated.

  8. fanquake merged this on Jul 22, 2020
  9. fanquake closed this on Jul 22, 2020

  10. Fabcien referenced this in commit 4020a21556 on Feb 3, 2021
  11. 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