Skip to content

Commit

Permalink
fabtest: Fix compilation error about CMPLX with C99
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
j-xiong committed Oct 24, 2024
1 parent 0387190 commit 8457ba6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fabtests/include/unix/osd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8457ba6

Please sign in to comment.