Skip to content

Conversation

@avar
Copy link

@avar avar commented May 4, 2016

In v0.9.0rc2-4332-g8f0d79e the src/test/scheduler_tests.cpp test was
disabled, but it was done in such a way as to define a function that
then was no longer used, leading to this warning under at least my GCC
4.9.2-10:

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

Fix this by just moving the "#if 0" a few lines up so that it also
defines out a function used only by this test.

In v0.9.0rc2-4332-g8f0d79e the src/test/scheduler_tests.cpp test was
disabled, but it was done in such a way as to define a function that
then was no longer used, leading to this warning under at least my GCC
4.9.2-10:

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

Fix this by just moving the "#if 0" a few lines up so that it also
defines out a function used only by this test.
@avar
Copy link
Author

avar commented May 4, 2016

B.t.w. the failed travis run seems to have to do with some generic travis issue instead of an issue with this patch, the tests stopped after getting no output for 10 minutes.

@paveljanik
Copy link
Contributor

See #7169.

@laanwj
Copy link
Member

laanwj commented May 5, 2016

This is the easy way out. Please fix the test instead.
(see See #7144, #6540)

@laanwj laanwj added the Tests label May 5, 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.
@avar avar closed this May 5, 2016
@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants