Skip to content

Commit

Permalink
DAOS-16826 build: Fix compiling issues in gcc 14 (#15531) (#15607)
Browse files Browse the repository at this point in the history
* Fix compiling issues in gcc 14

Signed-off-by: Jinshan Xiong <[email protected]>
Co-authored-by: Dalton Bohning <[email protected]>
Co-authored-by: Jeff Olivier <[email protected]>
  • Loading branch information
daltonbohning and jolivier23 authored Dec 16, 2024
1 parent 332f412 commit a4f8be7
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions site_scons/site_tools/compiler_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

DESIRED_FLAGS = ['-fstack-usage',
'-Wno-sign-compare',
'-Wno-missing-attributes',
'-Wno-unused-parameter',
'-Wno-missing-field-initializers',
'-Wno-implicit-fallthrough',
Expand Down
2 changes: 1 addition & 1 deletion src/client/dfuse/dfuse_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,7 @@ dfuse_fs_start(struct dfuse_info *dfuse_info, struct dfuse_cont *dfs)
* standard allocation macros
*/
args.allocated = 1;
args.argv = calloc(sizeof(*args.argv), args.argc);
args.argv = calloc(args.argc, sizeof(*args.argv));
if (!args.argv)
D_GOTO(err, rc = -DER_NOMEM);

Expand Down
2 changes: 1 addition & 1 deletion src/gurt/telemetry.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ d_tm_init_with_name(int id, uint64_t mem_size, int flags, const char *root_name)
{
struct d_tm_shmem_hdr *new_shmem = NULL;
key_t key;
int shmid;
int shmid = 0;
int rc = DER_SUCCESS;

if (root_name == NULL || strnlen(root_name, D_TM_MAX_NAME_LEN) == 0) {
Expand Down
3 changes: 1 addition & 2 deletions src/placement/tests/benchmark_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ benchmark_alloc(void)
{
struct benchmark_handle *hdl;

hdl = (struct benchmark_handle *)calloc(sizeof(struct benchmark_handle),
1);
hdl = (struct benchmark_handle *)calloc(1, sizeof(struct benchmark_handle));
if (hdl == NULL)
return NULL;

Expand Down
2 changes: 1 addition & 1 deletion src/placement/tests/jump_map_place_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,7 @@ drain_target_same_shard_repeatedly_for_all_shards(void **state)
int i;
uint32_t shard_id = 0;
uint32_t target;
uint32_t new_target;
uint32_t new_target = 0;

for (shard_id = 0; shard_id < 18; shard_id++) {
jtc_init_with_layout(&ctx, 18 * 2, 1, 4, OC_EC_16P2G1,
Expand Down
4 changes: 2 additions & 2 deletions src/utils/crt_launch/crt_launch.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,13 @@ int main(int argc, char **argv)
par_rank(PAR_COMM_WORLD, &my_rank);
par_size(PAR_COMM_WORLD, &world_size);

hostbuf = calloc(sizeof(*hostbuf), 1);
hostbuf = calloc(1, sizeof(*hostbuf));
if (!hostbuf) {
D_ERROR("Failed to allocate hostbuf\n");
D_GOTO(exit, rc = -1);
}

recv_buf = calloc(sizeof(struct host), world_size);
recv_buf = calloc(world_size, sizeof(*recv_buf));
if (!recv_buf) {
D_ERROR("Failed to allocate recv_buf\n");
D_GOTO(exit, rc = -1);
Expand Down

0 comments on commit a4f8be7

Please sign in to comment.