aports/testing/py3-py-radix/gcc14.patch

44 lines
1.6 KiB
Diff

Source: https://github.com/mjschultz/py-radix/pull/58.patch
Fix -Wincompatible-pointer-types error with gcc 14.
```
radix/_radix.c: In function 'add_node_to_list':
radix/_radix.c:528:37: error: passing argument 2 of 'PyList_Append' from
incompatible pointer type [-Wincompatible-pointer-types]
528 | PyList_Append(ret, ((RadixNodeObject *)node->data));
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| RadixNodeObject *
In file included from /usr/include/python3.12/Python.h:63,
from radix/_radix.c:18:
/usr/include/python3.12/listobject.h:34:43: note: expected 'PyObject *' {aka
'struct _object *'} but argument is of type 'RadixNodeObject *'
34 | PyAPI_FUNC(int) PyList_Append(PyObject *, PyObject *);
| ^~~~~~~~~~
```
--
From ce1da838d74031cfbd3c4dae3a28b9c3c11b5000 Mon Sep 17 00:00:00 2001
From: Robert Scheck <robert@fedoraproject.org>
Date: Sun, 16 Jun 2024 19:03:43 +0200
Subject: [PATCH] Change incompatible pointer type from RadixNodeObject to
PyObject
---
radix/_radix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/radix/_radix.c b/radix/_radix.c
index 5a1b88f..5dcfc59 100644
--- a/radix/_radix.c
+++ b/radix/_radix.c
@@ -524,7 +524,7 @@ add_node_to_list(radix_node_t *node, void *arg)
PyObject *ret = arg;
if (node->data != NULL)
- PyList_Append(ret, ((RadixNodeObject *)node->data));
+ PyList_Append(ret, ((PyObject *)node->data));
return (0);
}