Skip to content

Commit

Permalink
fix: silence clangsa warnings on pointer mismatch
Browse files Browse the repository at this point in the history
match the sizeof(type) to the pointer type we're assigning to.
  • Loading branch information
aws-nslick committed Feb 22, 2024
1 parent b2e44e4 commit e413ee4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/nccl_ofi_rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -5895,7 +5895,7 @@ int nccl_net_ofi_rdma_init(nccl_ofi_topo_t *topo,
goto error;
}

base_devs = calloc(num_devs, sizeof(nccl_net_ofi_rdma_device_t *));
base_devs = calloc(num_devs, sizeof(nccl_net_ofi_device_t *));
if (!base_devs) {
NCCL_OFI_WARN("Unable to allocate "
"nccl_net_ofi_rdma_device_t pointer array");
Expand Down
2 changes: 1 addition & 1 deletion src/nccl_ofi_sendrecv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2216,7 +2216,7 @@ int nccl_net_ofi_sendrecv_init(struct fi_info* ofi_info_list,
goto exit;
}

base_devs = malloc(num_infos * sizeof(nccl_net_ofi_sendrecv_device_t *));
base_devs = malloc(num_infos * sizeof(nccl_net_ofi_device_t *));
if (!base_devs) {
NCCL_OFI_WARN("Unable to allocate "
"nccl_net_ofi_sendrecv_device_t pointer array");
Expand Down

0 comments on commit e413ee4

Please sign in to comment.