mirror of
https://git.freebsd.org/ports.git
synced 2025-05-05 16:07:38 -04:00
Clang 16 has a new error about incompatible function types, which shows up when building net/libfabric (on i386): prov/hook/src/hook_domain.c:124:12: error: incompatible function pointer types passing 'ssize_t (struct fid_ep *, size_t)' (aka 'int (struct fid_ep *, unsigned int)') to parameter of type 'ssize_t (*)(struct fid_ep *, uint64_t)' (aka 'int (*)(struct fid_ep *, unsigned long long)') [-Wincompatible-function-pointer-types] hook_credit_handler); ^~~~~~~~~~~~~~~~~~~ prov/hook/src/hook_domain.c:150:17: error: incompatible function pointer types initializing 'void (*)(struct fid_ep *, uint64_t)' (aka 'void (*)(struct fid_ep *, unsigned long long)') with an expression of type 'void (struct fid_ep *, size_t)' (aka 'void (struct fid_ep *, unsigned int)') [-Wincompatible-function-pointer-types] .add_credits = hook_add_credits, ^~~~~~~~~~~~~~~~ prov/hook/src/hook_domain.c:152:22: error: incompatible function pointer types initializing 'void (*)(struct fid_domain *, ssize_t (*)(struct fid_ep *, uint64_t))' (aka 'void (*)(struct fid_domain *, int (*)(struct fid_ep *, unsigned long long))') with an expression of type 'void (struct fid_domain *, ssize_t (*)(struct fid_ep *, size_t))' (aka 'void (struct fid_domain *, int (*)(struct fid_ep *, unsigned int))') [-Wincompatible-function-pointer-types] .set_send_handler = hook_set_send_handler, ^~~~~~~~~~~~~~~~~~~~~ The problem is that the 'credits' parameter used in these functions is size_t in some cases, but uint64_t in other cases. On LP64 architectures this does not result in any errors, but on e.g. i386 you get the above. Make the 'credits' parameter uint64_t everywhere to fix this issue. PR: 271537 Approved by: yuri (maintainer) MFH: 2023Q2
25 lines
918 B
C
25 lines
918 B
C
--- prov/rxm/src/rxm_domain.c.orig 2022-04-30 21:46:32 UTC
|
|
+++ prov/rxm/src/rxm_domain.c
|
|
@@ -567,7 +621,7 @@ static struct fi_ops_mr rxm_domain_mr_thru_ops = {
|
|
.regattr = rxm_mr_regattr_thru,
|
|
};
|
|
|
|
-static ssize_t rxm_send_credits(struct fid_ep *ep, size_t credits)
|
|
+static ssize_t rxm_send_credits(struct fid_ep *ep, uint64_t credits)
|
|
{
|
|
struct rxm_conn *rxm_conn = ep->fid.context;
|
|
struct rxm_ep *rxm_ep = rxm_conn->ep;
|
|
@@ -620,11 +674,11 @@ defer:
|
|
return FI_SUCCESS;
|
|
}
|
|
|
|
-static void rxm_no_add_credits(struct fid_ep *ep_fid, size_t credits)
|
|
+static void rxm_no_add_credits(struct fid_ep *ep_fid, uint64_t credits)
|
|
{ }
|
|
|
|
static void rxm_no_credit_handler(struct fid_domain *domain_fid,
|
|
- ssize_t (*credit_handler)(struct fid_ep *ep, size_t credits))
|
|
+ ssize_t (*credit_handler)(struct fid_ep *ep, uint64_t credits))
|
|
{ }
|
|
|
|
static int rxm_no_enable_flow_ctrl(struct fid_ep *ep_fid, uint64_t threshold)
|