Skip to content

Commit 7d6c646

Browse files
committed
Merge bitcoin#28348: build: Bump g++ minimum supported version to 10
fa5423b refactor: Remove unused gcc-9 workaround in txrequest (MarcoFalke) fa918d3 Always enable -Wsuggest-override (MarcoFalke) faea58e Bump g++ minimum supported version to 10 (MarcoFalke) Pull request description: All supported operating systems ship with g++ 10 (or later), so bumping the minimum should not cause any issues. The bump allows to drop some now-unused workarounds. For reference: * https://packages.debian.org/bullseye/g++ (`g++-10`) * https://packages.ubuntu.com/focal/g++-10 * FreeBSD 12/13 ships with g++ 12 * CentOS-like 9 ships with g++ 11 * OpenSuse Tumbleweed ships with g++ 13 https://software.opensuse.org/package/gcc13-c++ (No idea about OpenSuse Leap) This is for Bitcoin Core 27.0 in 2024 (next year), not the soon upcoming 26.0 next month. ACKs for top commit: fanquake: ACK fa5423b Tree-SHA512: 6f0697ae4c0f578873591b7872bf158aba3af17f171c3556b593a70ec379bf94c7a9dd7697e8e79173edd4ac3c81a376e0cbbc0cfabde1a1cfe5f9b5eaea6831
2 parents 6391644 + fa5423b commit 7d6c646

File tree

5 files changed

+11
-21
lines changed

5 files changed

+11
-21
lines changed

ci/test/00_setup_env_native_qt5.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ export LC_ALL=C.UTF-8
88

99
export CONTAINER_NAME=ci_native_qt5
1010
export CI_IMAGE_NAME_TAG="docker.io/debian:bullseye"
11-
# Use minimum supported python3.9 and gcc-9, see doc/dependencies.md
12-
export PACKAGES="gcc-9 g++-9 python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev"
13-
export DEP_OPTS="NO_QT=1 NO_UPNP=1 NO_NATPMP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1 CC=gcc-9 CXX=g++-9"
11+
# Use minimum supported python3.9 and gcc-10, see doc/dependencies.md
12+
export PACKAGES="gcc-10 g++-10 python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev"
13+
export DEP_OPTS="NO_QT=1 NO_UPNP=1 NO_NATPMP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1 CC=gcc-10 CXX=g++-10"
1414
export TEST_RUNNER_EXTRA="--previous-releases --coverage --extended --exclude feature_dbcrash" # Run extended tests so that coverage does not fail, but exclude the very slow dbcrash
1515
export RUN_UNIT_TESTS_SEQUENTIAL="true"
1616
export RUN_UNIT_TESTS="false"
1717
export GOAL="install"
18-
export NO_WERROR=1 # -Werror=maybe-uninitialized
1918
export DOWNLOAD_PREVIOUS_RELEASES="true"
2019
export BITCOIN_CONFIG="--enable-zmq --with-libs=no --with-gui=qt5 --enable-reduce-exports --enable-debug \
2120
CFLAGS=\"-g0 -O2 -funsigned-char\" CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE' CXXFLAGS=\"-g0 -O2 -funsigned-char\""

configure.ac

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,7 @@ if test "$CXXFLAGS_overridden" = "no"; then
447447
AX_CHECK_COMPILE_FLAG([-Wduplicated-cond], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wduplicated-cond"], [], [$CXXFLAG_WERROR])
448448
AX_CHECK_COMPILE_FLAG([-Wlogical-op], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wlogical-op"], [], [$CXXFLAG_WERROR])
449449
AX_CHECK_COMPILE_FLAG([-Woverloaded-virtual], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Woverloaded-virtual"], [], [$CXXFLAG_WERROR])
450-
dnl -Wsuggest-override is broken with GCC before 9.2
451-
dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78010
452-
AX_CHECK_COMPILE_FLAG([-Wsuggest-override], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsuggest-override"], [], [$CXXFLAG_WERROR],
453-
[AC_LANG_SOURCE([[struct A { virtual void f(); }; struct B : A { void f() final; };]])])
450+
AX_CHECK_COMPILE_FLAG([-Wsuggest-override], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsuggest-override"], [], [$CXXFLAG_WERROR])
454451
AX_CHECK_COMPILE_FLAG([-Wunreachable-code-loop-increment], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunreachable-code-loop-increment"], [], [$CXXFLAG_WERROR])
455452
AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wimplicit-fallthrough"], [], [$CXXFLAG_WERROR])
456453

doc/dependencies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You can find installation instructions in the `build-*.md` file for your platfor
99
| [Autoconf](https://www.gnu.org/software/autoconf/) | [2.69](https://github.com/bitcoin/bitcoin/pull/17769) |
1010
| [Automake](https://www.gnu.org/software/automake/) | [1.13](https://github.com/bitcoin/bitcoin/pull/18290) |
1111
| [Clang](https://clang.llvm.org) | [13.0](https://github.com/bitcoin/bitcoin/pull/28210) |
12-
| [GCC](https://gcc.gnu.org) | [9.1](https://github.com/bitcoin/bitcoin/pull/27662) |
12+
| [GCC](https://gcc.gnu.org) | [10.1](https://github.com/bitcoin/bitcoin/pull/28348) |
1313
| [Python](https://www.python.org) (scripts, tests) | [3.9](https://github.com/bitcoin/bitcoin/pull/28211) |
1414
| [systemtap](https://sourceware.org/systemtap/) ([tracing](tracing.md))| N/A |
1515

src/txrequest.cpp

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,10 @@ struct Announcement {
7272
/** Whether this is a wtxid request. */
7373
const bool m_is_wtxid : 1;
7474

75-
/** What state this announcement is in.
76-
* This is a uint8_t instead of a State to silence a GCC warning in versions prior to 9.3.
77-
* See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414 */
78-
uint8_t m_state : 3;
79-
80-
/** Convert m_state to a State enum. */
81-
State GetState() const { return static_cast<State>(m_state); }
82-
83-
/** Convert a State enum to a uint8_t and store it in m_state. */
84-
void SetState(State state) { m_state = static_cast<uint8_t>(state); }
75+
/** What state this announcement is in. */
76+
State m_state : 3;
77+
State GetState() const { return m_state; }
78+
void SetState(State state) { m_state = state; }
8579

8680
/** Whether this announcement is selected. There can be at most 1 selected peer per txhash. */
8781
bool IsSelected() const
@@ -105,7 +99,7 @@ struct Announcement {
10599
Announcement(const GenTxid& gtxid, NodeId peer, bool preferred, std::chrono::microseconds reqtime,
106100
SequenceNumber sequence) :
107101
m_txhash(gtxid.GetHash()), m_time(reqtime), m_peer(peer), m_sequence(sequence), m_preferred(preferred),
108-
m_is_wtxid(gtxid.IsWtxid()), m_state(static_cast<uint8_t>(State::CANDIDATE_DELAYED)) {}
102+
m_is_wtxid{gtxid.IsWtxid()}, m_state{State::CANDIDATE_DELAYED} {}
109103
};
110104

111105
//! Type alias for priorities.

src/util/hasher.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class SaltedOutpointHasher
4545
* a slight performance penalty (around 1.6%), but this is compensated by
4646
* memory savings of about 9% which allow for a larger dbcache setting.
4747
*
48-
* @see https://gcc.gnu.org/onlinedocs/gcc-9.2.0/libstdc++/manual/manual/unordered_associative.html
48+
* @see https://gcc.gnu.org/onlinedocs/gcc-13.2.0/libstdc++/manual/manual/unordered_associative.html
4949
*/
5050
size_t operator()(const COutPoint& id) const noexcept {
5151
return SipHashUint256Extra(k0, k1, id.hash, id.n);

0 commit comments

Comments
 (0)