Skip to content

Commit

Permalink
fabtests: Fix compiler warning about unitialized variable
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
j-xiong committed Oct 30, 2024
1 parent 5ae97ef commit 6cdfb7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fabtests/common/shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6cdfb7e

Please sign in to comment.