Newer glibc needs to have all variables be size_t even those which are computed into other variables.
Opened this issue · 0 comments
hariharan-devarajan commented
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