From 6cdfb7eee1430208a90c57c0be31fecbc1aaea61 Mon Sep 17 00:00:00 2001 From: Jianxin Xiong Date: Tue, 29 Oct 2024 11:22:30 -0700 Subject: [PATCH] fabtests: Fix compiler warning about unitialized variable The compiler can't properly follow the def-use chain guarded by the same condition and complains about the variable could be used w/o initialization: if (atomic == FI_ATOMIC_COMPARE) { check_cmp = ...; } ...... if (atomic == FI_ATOMIC_COMPARE) { use check_cmp in macro } Signed-off-by: Jianxin Xiong --- fabtests/common/shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fabtests/common/shared.c b/fabtests/common/shared.c index 40f53c84f6b..646a2ea1eab 100644 --- a/fabtests/common/shared.c +++ b/fabtests/common/shared.c @@ -3843,7 +3843,7 @@ int ft_check_atomic(enum ft_atomic_opcodes atomic, enum fi_op op, void *cmp, void *res, size_t count) { int ret = 0; - void *check_res = res, *check_buf, *check_comp; + void *check_res = res, *check_buf, *check_comp = cmp; /* * If we don't have the test function, return > 0 to indicate