Skip to content

Commit 392dc68

Browse files
committed
Merge bitcoin/bitcoin#26924: refactor: Add missing includes to fix gcc-13 compile error
fadeb6b Add missing includes to fix gcc-13 compile error (MarcoFalke) Pull request description: On current master: ``` CXX support/libbitcoin_util_a-lockedpool.o support/lockedpool.cpp: In member function ‘void Arena::free(void*)’: support/lockedpool.cpp:99:20: error: ‘runtime_error’ is not a member of ‘std’ 99 | throw std::runtime_error("Arena: invalid or double free"); | ^~~~~~~~~~~~~ support/lockedpool.cpp:22:1: note: ‘std::runtime_error’ is defined in header ‘<stdexcept>’; did you forget to ‘#include <stdexcept>’? 21 | #include <algorithm> +++ |+#include <stdexcept> 22 | #ifdef ARENA_DEBUG support/lockedpool.cpp: In member function ‘void LockedPool::free(void*)’: support/lockedpool.cpp:320:16: error: ‘runtime_error’ is not a member of ‘std’ 320 | throw std::runtime_error("LockedPool: invalid address not pointing to any arena"); | ^~~~~~~~~~~~~ support/lockedpool.cpp:320:16: note: ‘std::runtime_error’ is defined in header ‘<stdexcept>’; did you forget to ‘#include <stdexcept>’? ACKs for top commit: hebasto: ACK fadeb6b. fanquake: ACK fadeb6b - tested this fixes compilation with GCC 13. I don't think theres a need to do anything else here, and that'd also just potentially complicate backporting. Tree-SHA512: 99f79cf385c913138a9cf9fc23be0a3a067b0a28518b8bdc033a7220b85bbc5d18f5356c5bdad2f628c22abb87c18b232724f606eba6326c031518559054be31
2 parents eebc24b + fadeb6b commit 392dc68

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/support/lockedpool.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
#endif
2020

2121
#include <algorithm>
22+
#include <limits>
23+
#include <stdexcept>
24+
#include <utility>
2225
#ifdef ARENA_DEBUG
2326
#include <iomanip>
2427
#include <iostream>

src/support/lockedpool.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
#ifndef BITCOIN_SUPPORT_LOCKEDPOOL_H
66
#define BITCOIN_SUPPORT_LOCKEDPOOL_H
77

8-
#include <stdint.h>
8+
#include <cstddef>
99
#include <list>
1010
#include <map>
11-
#include <mutex>
1211
#include <memory>
12+
#include <mutex>
1313
#include <unordered_map>
1414

1515
/**

0 commit comments

Comments
 (0)