Skip to content

Conversation

@paveljanik
Copy link
Contributor

After #7144, some compilers emit warnings about unused functions in the scheduler tests:

  CXX      test/test_test_bitcoin-scheduler_tests.o
test/scheduler_tests.cpp:18:13: warning: function 'microTask' is not needed and will not be emitted [-Wunneeded-internal-declaration]
static void microTask(CScheduler& s, boost::mutex& mutex, int& counter, int delta, boost::chrono::system_clock::time_point rescheduleTime)
            ^
test/scheduler_tests.cpp:31:13: warning: unused function 'MicroSleep' [-Wunused-function]
static void MicroSleep(uint64_t n)
            ^
2 warnings generated.

Moving #if 0 a bit up helps to silence this warning.

@laanwj
Copy link
Member

laanwj commented Dec 4, 2015

TBH, the underlying issue with the test (or scheduler) should be solved instead. This is a good reminder. No need to silence a warning that points out an actual problem.

See #7144, #6540

@laanwj laanwj closed this Jan 20, 2016
avar added a commit to avar/bitcoin that referenced this pull request May 5, 2016
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 bitcoin#8003 and
bitcoin#7169 for past attempts to fix
this warning which have been rejected.
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants