Fix compilation with modern GCC (Ubuntu 24.04+)

Add missing C++ standard library includes required by GCC 13+ and newer
toolchains. These headers were previously included implicitly through
other headers in older GCC versions (e.g., GCC 9 on Ubuntu 20.04), but
modern compilers require explicit includes per C++ standard compliance.

Changes:
- Add <cstdint> to util/bip32.h for uint32_t type definitions
- Add <array> to net_processing.cpp for std::array
- Add <stdexcept> to multiple headers for exception types:
  * support/events.h (std::runtime_error)
  * dbwrapper.h (std::runtime_error base class)
  * streams.h (std::out_of_range, std::ios_base::failure)
  * coins.h (std::logic_error)
  * wallet/coinselection.h (std::invalid_argument, std::out_of_range)
  * rpc/util.h (std::runtime_error)
  * support/lockedpool.h (std::runtime_error)
  * support/lockedpool.cpp (std::runtime_error)
  * wallet/scriptpubkeyman.h (std::runtime_error)

This ensures compatibility across different compiler versions and
architectures (ARM64/x86_64) while maintaining backward compatibility
with older toolchains.

Tested on Ubuntu 24.04 with GCC 13.
This commit is contained in:
2026-01-26 17:30:11 +01:00
parent 5145f76aa9
commit 21ae070217
11 changed files with 15 additions and 1 deletions

View File

@@ -18,6 +18,7 @@
#include <stdint.h>
#include <functional>
#include <stdexcept>
#include <unordered_map>
/**

View File

@@ -12,6 +12,8 @@
#include <util/system.h>
#include <util/strencodings.h>
#include <stdexcept>
#include <leveldb/db.h>
#include <leveldb/write_batch.h>

View File

@@ -27,6 +27,7 @@
#include <util/system.h>
#include <util/strencodings.h>
#include <array>
#include <memory>
#include <typeinfo>

View File

@@ -17,6 +17,7 @@
#include <univalue.h>
#include <util/check.h>
#include <stdexcept>
#include <string>
#include <vector>

View File

@@ -13,6 +13,7 @@
#include <assert.h>
#include <ios>
#include <limits>
#include <stdexcept>
#include <stdint.h>
#include <stdio.h>
#include <string>

View File

@@ -7,6 +7,7 @@
#include <ios>
#include <memory>
#include <stdexcept>
#include <event2/event.h>
#include <event2/http.h>

View File

@@ -23,6 +23,7 @@
#endif
#include <algorithm>
#include <stdexcept>
#ifdef ARENA_DEBUG
#include <iomanip>
#include <iostream>

View File

@@ -8,8 +8,9 @@
#include <stdint.h>
#include <list>
#include <map>
#include <mutex>
#include <memory>
#include <mutex>
#include <stdexcept>
#include <unordered_map>
/**

View File

@@ -6,6 +6,7 @@
#define PALLADIUM_UTIL_BIP32_H
#include <attributes.h>
#include <cstdint>
#include <string>
#include <vector>

View File

@@ -9,6 +9,8 @@
#include <primitives/transaction.h>
#include <random.h>
#include <stdexcept>
//! target minimum change amount
static constexpr CAmount MIN_CHANGE{COIN / 100};
//! final minimum change amount after paying for fees

View File

@@ -15,6 +15,8 @@
#include <wallet/walletdb.h>
#include <wallet/walletutil.h>
#include <stdexcept>
#include <boost/signals2/signal.hpp>
enum class OutputType;