From 8457ba6b58288d0e8fca7f1d2d44920b01689812 Mon Sep 17 00:00:00 2001 From: Jianxin Xiong Date: Wed, 23 Oct 2024 10:18:11 -0700 Subject: [PATCH] fabtest: Fix compilation error about CMPLX with C99 CMPLX is introduced in C11, it may be undefined in C99. Compilation error was observed with Coverity scan. Construct the complex number directly. It also handles float complex and long double complex better. Signed-off-by: Jianxin Xiong --- fabtests/include/unix/osd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fabtests/include/unix/osd.h b/fabtests/include/unix/osd.h index 66956aeb79f..0c3200b0468 100644 --- a/fabtests/include/unix/osd.h +++ b/fabtests/include/unix/osd.h @@ -125,7 +125,7 @@ static inline void OFI_COMPLEX_OP(name, set)(OFI_COMPLEX(name) *v1, OFI_COMPLEX( } \ static inline void OFI_COMPLEX_OP(name, fill)(OFI_COMPLEX(name) *v1, name v2) \ { \ - *v1 = CMPLX(v2, v2); \ + *v1 = (OFI_COMPLEX(name))((name)(v2) + I * (name)(v2)); \ } OFI_COMPLEX_OPS(float)