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

Newer glibc needs to have all variables be size_t even those which are computed into other variables. #731

Open
hariharan-devarajan opened this issue Aug 16, 2022 · 0 comments

Comments

@hariharan-devarajan
Copy link
Member

Description

In the newer version of glibc this is a compile-time error.

client_read.c:697:30: error: argument 1 range [18446744071562067968, 18446744073709551614] exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=]
         reqs = (read_req_t*) calloc(reqs_size, sizeof(read_req_t));

The solution is to change the signature of process_gfid_reads to use size_t in_count.

diff --git a/client/src/client_read.c b/client/src/client_read.c
index bb562e6..d187db6 100644
--- a/client/src/client_read.c
+++ b/client/src/client_read.c
@@ -584,7 +584,7 @@ static void update_read_req_result(unifyfs_client* client,
  */
 int process_gfid_reads(unifyfs_client* client,
                        read_req_t* in_reqs,
-                       size_t in_count)
+                       int in_count)
 {
     if (0 == in_count) {
         return UNIFYFS_SUCCESS;
diff --git a/client/src/client_read.h b/client/src/client_read.h
index 45e89c3..517ca09 100644
--- a/client/src/client_read.h
+++ b/client/src/client_read.h
@@ -111,6 +111,6 @@ void update_read_req_coverage(read_req_t* req,
 /* process a set of client read requests */
 int process_gfid_reads(unifyfs_client* client,
                        read_req_t* in_reqs,
-                       size_t in_count);
+                       int in_count);
 
 #endif // UNIFYFS_CLIENT_READ_H

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant