Get rid of a compiler warning due to #if 0'd test#8003
Closed
avar wants to merge 1 commit intobitcoin:masterfrom
Closed
Get rid of a compiler warning due to #if 0'd test#8003avar wants to merge 1 commit intobitcoin:masterfrom
avar wants to merge 1 commit intobitcoin:masterfrom
Conversation
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.
Author
|
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. |
Contributor
|
See #7169. |
Member
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.