Skip to content

Commit 3c12be3

Browse files
committed
UCS/BITMAP/TEST: Fix build with >= Clang 21
First caught on Gentoo LLVM with Clang 21.1.5 and LLVM 21.1.5 Build with fail with the following error message core/ucp_context.c:2673:47: error: default initialization of an object of type 'typeof (*tl_bitmap_super)' (aka 'const ucp_tl_bitmap_t') leaves the object uninitialized [-Werror,-Wdefault-const-init-var-unsafe] /var/tmp/portage/sys-cluster/ucx-1.19.0/work/ucx-1.19.0/src/ucs/datastruct/static_bitmap.h:250:5: note: expanded from macro 'UCS_STATIC_BITMAP_NOT' 250 | UCS_STATIC_BITMAP_UNARY_OP(_bitmap, not, UCS_PP_UNIQUE_ID) | ^ /var/tmp/portage/sys-cluster/ucx-1.19.0/work/ucx-1.19.0/src/ucs/datastruct/static_bitmap.h:239:5: note: expanded from macro 'UCS_STATIC_BITMAP_UNARY_OP' 239 | _UCS_STATIC_BITMAP_UNARY_OP(_bitmap, _op_name, _uid) | ^ /var/tmp/portage/sys-cluster/ucx-1.19.0/work/ucx-1.19.0/src/ucs/datastruct/static_bitmap.h:232:29: note: expanded from macro '_UCS_STATIC_BITMAP_UNARY_OP' 232 | ucs_typeof(_bitmap) _r_##_uid; \ | ^ <scratch space>:54:1: note: expanded from here 54 | _r_0 | ^ core/ucp_context.c:2672:25: error: default initialization of an object of type 'typeof (*tl_bitmap)' (aka 'const ucp_tl_bitmap_t') leaves the object uninitialized [-Werror,-Wdefault-const-init-var-unsafe] 2672 | ucp_tl_bitmap_t b = UCS_STATIC_BITMAP_AND(*tl_bitmap, | ^ The cause is probably Clang now being more strict and ucs_typeof(_bitmap) _r_##_uid being declared and not used. Signed-off-by: Brahmajit Das <[email protected]>
1 parent e29e5f5 commit 3c12be3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ucs/datastruct/static_bitmap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ BEGIN_C_DECLS
229229
#define _UCS_STATIC_BITMAP_UNARY_OP(_bitmap, _op_name, _uid) \
230230
({ \
231231
ucs_typeof(_bitmap) _b_##_uid = (_bitmap); \
232-
ucs_typeof(_bitmap) _r_##_uid; \
232+
ucs_typeof(_bitmap) _r_##_uid = {0}; \
233233
\
234234
ucs_bitmap_bits_##_op_name(UCS_STATIC_BITMAP_BITS_ARGS(&_r_##_uid), \
235235
UCS_STATIC_BITMAP_BITS_CARGS(&_b_##_uid)); \
@@ -255,7 +255,7 @@ BEGIN_C_DECLS
255255
({ \
256256
ucs_typeof(_bitmap1) _b1_##_uid = (_bitmap1); \
257257
ucs_typeof(_bitmap2) _b2_##_uid = (_bitmap2); \
258-
ucs_typeof(_bitmap1) _r_##_uid; \
258+
ucs_typeof(_bitmap1) _r_##_uid = {0}; \
259259
\
260260
ucs_bitmap_bits_binary_op(UCS_STATIC_BITMAP_BITS_ARGS(&_r_##_uid), \
261261
UCS_STATIC_BITMAP_BITS_CARGS(&_b1_##_uid), \

0 commit comments

Comments
 (0)