This changes background_cs from being a pointer to a reference to work around a gcc false warning. Also, this makes the test easier to read.
Fixes bitcoin#23101
Can be reviewed with –ignore-all-space.
This changes background_cs from being a pointer to a reference to work around a gcc false warning. Also, this makes the test easier to read.
Fixes bitcoin#23101
Can be reviewed with –ignore-all-space.
This changes background_cs from being a pointer to a reference to work
around a gcc false warning. Also, this makes the test easier to read.
Fixes https://github.com/bitcoin/bitcoin/issues/23101
Can be reviewed with --ignore-all-space.
A description with a link to the issue it fixes would be nice.
The description is in the body of the commit message.
I agree that the description/link to issue should appear in the PR description, to make it easier for other contributors to quickly understand what the PR is doing.
Concept ACK
I’ve tried to make the PR title clearer, but I don’t know: does this only affect gcc 8.3 or a wider version range?
Nobody needs to sweat it, who cares, simply keep GCC 8.3 for now.
Ideally, you would find out the answer by reading CI workers’ logs, not by asking peers.
Concept ACK
I’ve tried to make the PR title clearer, but I don’t know: does this only affect gcc 8.3 or a wider version range? @laanwj note GCC 9 at #23149 (comment).
ACK https://github.com/bitcoin/bitcoin/pull/23132/commits/fa4d0aacf2bbddaf1709660ffd8d520570533aa8
Reviewed code on Github.
120+ return cs;
121+ }
122 }
123- }
124- BOOST_CHECK(background_cs);
125+ assert(false);
<cassert>
header?
assert
is already used in this file, so this seems unrelated.
ACK fa4d0aacf2bbddaf1709660ffd8d520570533aa8, tested on Linux Mint 20.2 (x86_64) by merging this PR on top of the current master.
Compiler:
0$ gcc --version
1gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
2Copyright (C) 2019 Free Software Foundation, Inc.
3This is free software; see the source for copying conditions. There is NO
4warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
0$ make > /dev/null
1test/fuzz/float.cpp: In function ‘void float_fuzz_target(FuzzBufferType)’:
2test/fuzz/float.cpp:60:30: warning: ‘tmp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
3 60 | assert(std::isnan(d) || d == d_deserialized);
4 | ^~
5In file included from ./validation.h:15,
6 from ./test/util/chainstate.h:13,
7 from test/validation_chainstate_tests.cpp:11:
8./chain.h: In member function ‘void validation_chainstate_tests::chainstate_update_tip::test_method()’:
9./chain.h:422:27: warning: ‘background_cs’ may be used uninitialized in this function [-Wmaybe-uninitialized]
10 422 | return vChain.size() > 0 ? vChain[vChain.size() - 1] : nullptr;
11 | ~~~~~~~~~~~^~
12test/validation_chainstate_tests.cpp:110:18: note: ‘background_cs’ was declared here
13 110 | CChainState* background_cs;
14 | ^~~~~~~~~~~~~
0$ make > /dev/null
1test/fuzz/float.cpp: In function ‘void float_fuzz_target(FuzzBufferType)’:
2test/fuzz/float.cpp:60:30: warning: ‘tmp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
3 60 | assert(std::isnan(d) || d == d_deserialized);
4 | ^~