diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2023-05-20 20:27:11 +0200 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2023-05-20 22:02:45 +0200 |
| commit | 26bc5ce8ba1e9cfbb40d77530b99307a98eac10d (patch) | |
| tree | 936b3be15f85e4656b6463d5223cb82acbd7fc8d /net/libfabric/files/patch-include_ofi__hook.h | |
| parent | devel/py-azure-mgmt-network: Update to 23.0.1 (diff) | |
net/libfabric: fix build with clang 16
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
Diffstat (limited to 'net/libfabric/files/patch-include_ofi__hook.h')
| -rw-r--r-- | net/libfabric/files/patch-include_ofi__hook.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/libfabric/files/patch-include_ofi__hook.h b/net/libfabric/files/patch-include_ofi__hook.h new file mode 100644 index 000000000000..bdc7ca538df7 --- /dev/null +++ b/net/libfabric/files/patch-include_ofi__hook.h @@ -0,0 +1,11 @@ +--- include/ofi_hook.h.orig 2022-04-30 21:46:31 UTC ++++ include/ofi_hook.h +@@ -163,7 +163,7 @@ struct hook_domain { + struct fid_domain *hdomain; + struct hook_fabric *fabric; + struct ofi_ops_flow_ctrl *base_ops_flow_ctrl; +- ssize_t (*base_credit_handler)(struct fid_ep *ep_fid, size_t credits); ++ ssize_t (*base_credit_handler)(struct fid_ep *ep_fid, uint64_t credits); + }; + + int hook_domain_init(struct fid_fabric *fabric, struct fi_info *info, |
