From 9feed9f4d199ed44c01ad0bd93751e7ad2898d7b Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 20 May 2026 09:09:40 +0200 Subject: [PATCH] fix(clang): disable default-const-init-field-unsafe clang was silently upgraded in CI to v21, and now warns openair2/RRC/NR/rrc_gNB_UE_context.c:70:24: error: default initialization of an object of type 'rrc_gNB_ue_context_t' (aka 'struct rrc_gNB_ue_context_s') with const member leaves the object uninitialized [-Werror,-Wdefault-const-init-field-unsafe] openair2/RRC/NR/rrc_gNB_UE_context.c:70:24: error: default initialization of an object of type 'rrc_gNB_ue_context_t' (aka 'struct rrc_gNB_ue_context_s') with const member leaves the object uninitialized [-Werror,-Wdefault-const-init-field-unsafe] openair2/RRC/NR/rrc_gNB_cuup.c:183:13: error: default initialization of an object of type 'seq_arr_t' (aka 'struct seq_arr_s') with const member leaves the object uninitialized [-Werror,-Wdefault-const-init-field-unsafe] openair2/RRC/NR/rrc_gNB_cuup.c:185:13: error: default initialization of an object of type 'seq_arr_t' (aka 'struct seq_arr_s') with const member leaves the object uninitialized [-Werror,-Wdefault-const-init-field-unsafe] openair2/RRC/NR/rrc_gNB_du.c:864:13: error: default initialization of an object of type 'seq_arr_t' (aka 'struct seq_arr_s') with const member leaves the object uninitialized [-Werror,-Wdefault-const-init-field-unsafe] Since this warning is new, and due to -Werror being used, the build now fails on the same code base. Disable this warning to get it build. Signed-off-by: Robert Schmidt --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d8b1a04a30..99efdcae22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,9 +221,9 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set(commonOpts "${commonOpts} -Wno-packed-bitfield-compat") endif() # clang: suppress complaints about unused command line argument (-rdynamic only -# used during linking) +# used during linking) and "const member leaves the object uninitialized" if(CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - set(commonOpts "${commonOpts} -Wno-unused-command-line-argument") + set(commonOpts "${commonOpts} -Wno-unused-command-line-argument -Wno-default-const-init-field-unsafe") endif() set(CMAKE_C_FLAGS