From d6e9986502cbb89c7a05d36234387f088c340ee7 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Thu, 12 Feb 2026 12:42:35 +0000 Subject: [PATCH] Silent uninitialized warning in gcc-14 Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> --- cmake/deps/Boost.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmake/deps/Boost.cmake b/cmake/deps/Boost.cmake index 9506693a8d..5f32e06d91 100644 --- a/cmake/deps/Boost.cmake +++ b/cmake/deps/Boost.cmake @@ -32,6 +32,16 @@ if (Boost_COMPILER) target_link_libraries(xrpl_boost INTERFACE Boost::disable_autolinking) endif () +# GCC 14+ has a false positive -Wuninitialized warning in Boost.Coroutine2's +# state.hpp when compiled with -O3. This is due to GCC's intentional behavior +# change (Bug #98871, #119388) where warnings from inlined system header code +# are no longer suppressed by -isystem. The warning occurs in operator|= in +# boost/coroutine2/detail/state.hpp when inlined from push_control_block::destroy(). +# See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119388 +if (is_gcc AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 14) + target_compile_options(xrpl_boost INTERFACE -Wno-uninitialized) +endif () + # Boost.Context's ucontext backend has ASAN fiber-switching annotations # (start/finish_switch_fiber) that are compiled in when BOOST_USE_ASAN is defined. # This tells ASAN about coroutine stack switches, preventing false positive