Add a comment indicating that the btc devs don't want a warning fixed #8005

pull avar wants to merge 1 commits into bitcoin:master from avar:note-that-unused-function-compiler-warning-should-not-be-fixed changing 1 files +5 −0
  1. avar commented at 8:59 AM on May 5, 2016: none

    The src/test/scheduler_tests.cpp test has been disabled since v0.9.0rc2-4332-g8f0d79e, since then it's been warning about the MicroSleep() function being unused, e.g. on GCC 4.9.2-10:

    test/scheduler_tests.cpp:32:13: warning: ‘void
    scheduler_tests::MicroSleep(uint64_t)’ defined but not used
    [-Wunused-function]
    

    The bitcoin developers don't want this warning fixed, and are instead using it as a reminder to fix the test. Since this is a rather unorthodox use of compiler warnings add a comment about this so people who build bitcoin and notice compiler warnings don't try to submit patches for this one.

    See #8003 and #7169 for past attempts to fix this warning which have been rejected.

  2. Add a comment indicating that the btc devs don't want a warning fixed
    The src/test/scheduler_tests.cpp test has been disabled since
    v0.9.0rc2-4332-g8f0d79e, since then it's been warning about the
    MicroSleep() function being unused, e.g. on GCC 4.9.2-10:
    
        test/scheduler_tests.cpp:32:13: warning: ‘void
        scheduler_tests::MicroSleep(uint64_t)’ defined but not used
        [-Wunused-function]
    
    The bitcoin developers don't want this warning fixed, and are instead
    using it as a reminder to fix the test. Since this is a rather
    unorthodox use of compiler warnings add a comment about this so people
    who build bitcoin and notice compiler warnings don't try to submit
    patches for this one.
    
    See https://github.com/bitcoin/bitcoin/pull/8003 and
    https://github.com/bitcoin/bitcoin/pull/7169 for past attempts to fix
    this warning which have been rejected.
    b5d33fd6f1
  3. laanwj commented at 9:06 AM on May 5, 2016: member

    I'd rather have the test fixed, or replaced by a test without the race condition.

    But given no one is doing that at the moment, this warning is fine with me.

  4. avar commented at 9:11 AM on May 5, 2016: none

    @laanwj Yes it's clear from the various refused pull requests that you want the test fixed and want to keep this warning. This pull request is not orthogonal to that, but is rather for noting that this "compiler warning as a reminder" shouldn't be fixed.

  5. laanwj commented at 10:27 AM on May 5, 2016: member

    I agree. On a higher level the philosophy of 'fixing compiler warnings' is wrong. It's fighting symptoms, not the underlying cause. It's like 'fixing' a building by papering over cracks. In a way it is compiler's own fault for crying wolf too many times, warning about silly things, so it's understandable, but I've often seen cases where people bash in compiler warnings without even considering the problem they're warning about - which were pointing out a legit bug.

  6. jonasschnelli added the label Tests on May 5, 2016
  7. laanwj commented at 10:09 AM on May 10, 2016: member

    No longer necessary after #8016, which fixes the underlying issue.

  8. laanwj closed this on May 10, 2016

  9. 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-13 21:15 UTC

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