Bug #2179
closedbest-route v2 test case: build error on OSX 10.9 with clang-500.2.79
100%
Description
../tests/daemon/fw/best-route-strategy2.cpp:98:60: error: variable 'periodicalRetxFrom4' is uninitialized when used within its own initialization [-Werror,-Wuninitialized]
retxFrom4Evt = scheduler::schedule(RETRANSMISSION_10P, periodicalRetxFrom4);
^~~~~~~~~~~~~~~~~~~
1 error generated.
Updated by Junxiao Shi about 10 years ago
This appears only on our Mac Mini, but I'm afraid it would start appearing elsewhere.
Updated by Alex Afanasyev about 10 years ago
This error doesn't make sense for me. There is no "own initialization", unless there is some compiler optimization that creates such thing.
What if you try to replace capture with &, periodicalRetxFrom4
(to copy periodicalRetxFrom4, instead of taking reference). Would this make things better or worse?
Updated by Junxiao Shi about 10 years ago
The edit proposed in note-2 yields:
../tests/daemon/fw/best-route-strategy2.cpp:85:46: error: variable 'periodicalRetxFrom4' is uninitialized when used within its own initialization [-Werror,-Wuninitialized]
function<void()> periodicalRetxFrom4 = [&, periodicalRetxFrom4] {
~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~
1 error generated.
I think scheduler
should provide a periodical scheduling feature. It's useful for this test case and also #2056.
Updated by Davide Pesavento about 10 years ago
In fact, I think the error makes sense. Using capture-by-value as suggested is completely wrong here, you have to capture periodicalRetxFrom4
by reference, but with a small variation. Try this:
function<void()> periodicalRetxFrom4;
periodicalRetxFrom4 = [&] {
...
}
Updated by Junxiao Shi about 10 years ago
- Status changed from New to In Progress
Updated by Junxiao Shi about 10 years ago
- Status changed from In Progress to Code review
- % Done changed from 0 to 100
Solution in note-4 works.
Updated by Junxiao Shi about 10 years ago
- Status changed from Code review to Closed