git: 4131f9bfd8d3 - main - sysutils/py-psutil: fix build with clang 15
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 18 Dec 2022 17:43:44 UTC
The branch main has been updated by dim (src committer):
URL: https://cgit.FreeBSD.org/ports/commit/?id=4131f9bfd8d3adb98d096856ee08d2ac7756d7cd
commit 4131f9bfd8d3adb98d096856ee08d2ac7756d7cd
Author: Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-12-07 15:06:16 +0000
Commit: Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-12-18 17:26:43 +0000
sysutils/py-psutil: fix build with clang 15
During an exp-run for llvm 15 (see bug 265425), it turned out that
sysutils/py-psutil failed to build with clang 15:
psutil/arch/freebsd/sys_socks.c:70:25: warning: comparison between pointer and integer ('kvaddr_t' (aka 'unsigned long long') and 'void *') [-Wpointer-integer-compare]
if (xf->xf_data == sock)
~~~~~~~~~~~ ^ ~~~~
psutil/arch/freebsd/sys_socks.c:182:40: error: incompatible integer to pointer conversion passing 'kvaddr_t' (aka 'unsigned long long') to parameter of type 'void *' [-Wint-conversion]
xf = psutil_get_file_from_sock(so->xso_so);
^~~~~~~~~~
psutil/arch/freebsd/sys_socks.c:65:33: note: passing argument to parameter 'sock' here
psutil_get_file_from_sock(void *sock) {
^
psutil/arch/freebsd/sys_socks.c:303:40: error: incompatible integer to pointer conversion passing 'kvaddr_t' (aka 'unsigned long long') to parameter of type 'void *' [-Wint-conversion]
xf = psutil_get_file_from_sock(xup->xu_socket.xso_so);
^~~~~~~~~~~~~~~~~~~~~
psutil/arch/freebsd/sys_socks.c:65:33: note: passing argument to parameter 'sock' here
psutil_get_file_from_sock(void *sock) {
^
1 warning and 2 errors generated.
This can be fixed by adjusting the psutil_get_file_from_sock() function
to take a kvaddr_t instead of a void pointer.
PR: 268233
Approved by: portmgr (tcberner)
MFH: 2022Q4
---
.../py-psutil/files/patch-psutil_arch_freebsd_sys__socks.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/sysutils/py-psutil/files/patch-psutil_arch_freebsd_sys__socks.c b/sysutils/py-psutil/files/patch-psutil_arch_freebsd_sys__socks.c
new file mode 100644
index 000000000000..04a9c7b6623c
--- /dev/null
+++ b/sysutils/py-psutil/files/patch-psutil_arch_freebsd_sys__socks.c
@@ -0,0 +1,11 @@
+--- psutil/arch/freebsd/sys_socks.c.orig 2022-09-02 10:06:38 UTC
++++ psutil/arch/freebsd/sys_socks.c
+@@ -62,7 +62,7 @@ struct xfile *
+
+
+ struct xfile *
+-psutil_get_file_from_sock(void *sock) {
++psutil_get_file_from_sock(kvaddr_t sock) {
+ struct xfile *xf;
+ int n;
+