Our current minimum supported Boost is 1.73.0
. However, when compiling with Boost 1.74.0
(Debian Stable), using Clang 18
, compilation fails with:
0In file included from /usr/include/boost/mpl/integral_c.hpp:32:
1/usr/include/boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for the enumeration type 'udt_builtin_mixture_enum' [-Wenum-constexpr-conversion]
2 73 | typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
3 | ^
4/usr/include/boost/mpl/aux_/static_cast.hpp:24:47: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST'
5 24 | # define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
6 | ^
7In file included from ../../../src/test/validation_chainstatemanager_tests.cpp:8:
8In file included from ../../../src/node/chainstatemanager_args.h:9:
9In file included from ../../../src/validation.h:28:
10In file included from ../../../src/txmempool.h:26:
11In file included from /usr/include/boost/multi_index/hashed_index.hpp:38:
12In file included from /usr/include/boost/multi_index/detail/node_handle.hpp:22:
13In file included from /usr/include/boost/multi_index_container_fwd.hpp:18:
14In file included from /usr/include/boost/multi_index/indexed_by.hpp:17:
15In file included from /usr/include/boost/mpl/vector.hpp:36:
16In file included from /usr/include/boost/mpl/vector/vector20.hpp:18:
17In file included from /usr/include/boost/mpl/vector/vector10.hpp:18:
18In file included from /usr/include/boost/mpl/vector/vector0.hpp:24:
19In file included from /usr/include/boost/mpl/vector/aux_/clear.hpp:18:
20In file included from /usr/include/boost/mpl/vector/aux_/vector0.hpp:22:
21In file included from /usr/include/boost/mpl/vector/aux_/iterator.hpp:19:
22In file included from /usr/include/boost/mpl/plus.hpp:19:
23In file included from /usr/include/boost/mpl/aux_/arithmetic_op.hpp:17:
24In file included from /usr/include/boost/mpl/integral_c.hpp:32:
25/usr/include/boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for the enumeration type 'int_float_mixture_enum' [-Wenum-constexpr-conversion]
26/usr/include/boost/mpl/aux_/static_cast.hpp:24:47: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST'
27 24 | # define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
28 | ^
292 errors generated.
Work around this issue by ignoring this diagnostic for this include. I did attempt to just downgrade the error into a warning, but that did not seem to work. Not a huge fan of inline warning/issue suppression, but this seems like the cleanest thing to do here (and easy to backport to 28.x
).
Can be tested with something like:
0docker pull debian:bookworm
1docker run -it debian:bookworm /bin/bash
2
3apt update && apt install ccache cmake git pkg-config libboost-dev libevent-dev python3 libsqlite3-dev lsb-release wget software-properties-common gnupg
4git clone https://github.com/bitcoin/bitcoin
5
6wget https://apt.llvm.org/llvm.sh
7chmod +x llvm.sh
8./llvm.sh 18
9
10cd bitcoin
11cmake -B build -DCMAKE_C_COMPILER=clang-18 -DCMAKE_CXX_COMPILER=clang++-18
12cmake --build build -j17
13<snip>
14In file included from /usr/include/boost/mpl/integral_c.hpp:32:
15/usr/include/boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for the enumeration type 'int_float_mixture_enum' [-Wenum-constexpr-conversion]
16/usr/include/boost/mpl/aux_/static_cast.hpp:24:47: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST'
17 24 | # define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
18 | ^
192 errors generated.
20
21Apply the patch
22
23cmake --build build -j17
24ctest --test-dir build -j17
Fixes #30751.