Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-16826 build: Fix compiling issues in gcc 14 #15531

Merged
merged 9 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/client/dfuse/dfuse_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,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
5 changes: 4 additions & 1 deletion src/client/dfuse/il/intercept.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
* fcntl (for now though we likely need for dup)
*/
#define FOREACH_ALIASED_INTERCEPT(ACTION) \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wmissing-attributes\"") \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we've seen something along these lines before, what's the actual issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it was complaining about fseek64() at https://codebrowser.dev/glibc/glibc/libio/stdio.h.html#780, where it has __nonnull((1)) attribute but ours doesn't have it.

BTW, I have gcc-13 installed as well, and it will hit the same issue; not sure why it can compile on Fedora . I'm using a Debian based system.

ACTION(FILE *, fopen, (const char *, const char *)) \
ACTION(FILE *, freopen, (const char *, const char *, FILE *)) \
ACTION(int, open, (const char *, int, ...)) \
Expand All @@ -40,7 +42,8 @@
ACTION(ssize_t, preadv, (int, const struct iovec *, int, off_t)) \
ACTION(ssize_t, pwritev, (int, const struct iovec *, int, off_t)) \
ACTION(off_t, ftello, (FILE *)) \
ACTION(int, ftruncate, (int, off_t))
ACTION(int, ftruncate, (int, off_t)) \
_Pragma("GCC diagnostic pop")

#define FOREACH_SINGLE_INTERCEPT(ACTION) \
ACTION(int, fclose, (FILE *)) \
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 @@ -280,13 +280,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
Loading