diff mbox series

[kirkstone,18/19] at-spi2-core: backport a patch to fix build with gcc-14 on host

Message ID e361d9e1021d7715d2b4e3af95832c910de67cad.1730228268.git.steve@sakoman.com
State RFC
Delegated to: Steve Sakoman
Headers show
Series [kirkstone,01/19] ghostscript: Backport CVE-2024-29508 | expand

Commit Message

Steve Sakoman Oct. 29, 2024, 6:59 p.m. UTC
From: Martin Jansa <martin.jansa@gmail.com>

* fixes:
| ../at-spi2-core-2.42.0/atspi/atspi-device-listener.c: In function ?atspi_device_listener_new_simple?:
| ../at-spi2-core-2.42.0/atspi/atspi-device-listener.c:252:37: error: passing argument 1 of ?atspi_device_listener_new? from incompatible pointer type [-Wincompatible-pointer-types]
|   252 |   return atspi_device_listener_new (device_remove_datum, callback, callback_destroyed);
|       |                                     ^~~~~~~~~~~~~~~~~~~
|       |                                     |
|       |                                     gboolean (*)(const AtspiDeviceEvent *, void *) {aka int (*)(const struct _AtspiDeviceEvent *, void *)}
| ../at-spi2-core-2.42.0/atspi/atspi-device-listener.c:222:50: note: expected ?AtspiDeviceListenerCB? {aka ?int (*)(struct _AtspiDeviceEvent *, void *)?} but argument is of type ?gboolean (*)(const AtspiDeviceEvent *, void *)? {aka ?int (*)(const struct _AtspiDeviceEvent *, void *)?}
|   222 | atspi_device_listener_new (AtspiDeviceListenerCB callback,
|       |                            ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~

Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 .../0001-Fix-function-prototype.patch         | 27 +++++++++++++++++++
 .../atk/at-spi2-core_2.42.0.bb                |  1 +
 2 files changed, 28 insertions(+)
 create mode 100644 meta/recipes-support/atk/at-spi2-core/0001-Fix-function-prototype.patch
diff mbox series

Patch

diff --git a/meta/recipes-support/atk/at-spi2-core/0001-Fix-function-prototype.patch b/meta/recipes-support/atk/at-spi2-core/0001-Fix-function-prototype.patch
new file mode 100644
index 0000000000..4fe7866ff7
--- /dev/null
+++ b/meta/recipes-support/atk/at-spi2-core/0001-Fix-function-prototype.patch
@@ -0,0 +1,27 @@ 
+From b29826379068a05cdd42ba6e956d17e4d6681c7b Mon Sep 17 00:00:00 2001
+From: Federico Mena Quintero <federico@gnome.org>
+Date: Tue, 23 Nov 2021 11:18:51 -0600
+Subject: [PATCH] Fix function prototype
+
+device_remove_datum already implicitly casts its cb to a
+AtspiDeviceListenerSimpleCB, which takes a const *event.
+
+Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
+Upstream-Status: Backport [v2.43.92 https://github.com/GNOME/at-spi2-core/commit/1e91fc4cff2080696be914e26f4cdf0bf32d1550]
+---
+ atspi/atspi-device-listener.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/atspi/atspi-device-listener.c b/atspi/atspi-device-listener.c
+index 69f77d1..9776ebd 100644
+--- a/atspi/atspi-device-listener.c
++++ b/atspi/atspi-device-listener.c
+@@ -53,7 +53,7 @@ device_event_handler_new (AtspiDeviceListenerCB callback,
+ }
+ 
+ static gboolean
+-device_remove_datum (const AtspiDeviceEvent *event, void *user_data)
++device_remove_datum (AtspiDeviceEvent *event, void *user_data)
+ {
+   AtspiDeviceListenerSimpleCB cb = user_data;
+   return cb (event);
diff --git a/meta/recipes-support/atk/at-spi2-core_2.42.0.bb b/meta/recipes-support/atk/at-spi2-core_2.42.0.bb
index 9ca969cbb8..97e09202fd 100644
--- a/meta/recipes-support/atk/at-spi2-core_2.42.0.bb
+++ b/meta/recipes-support/atk/at-spi2-core_2.42.0.bb
@@ -11,6 +11,7 @@  MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
 
 SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
            file://0001-Ensure-x11_dep-is-defined.patch \
+           file://0001-Fix-function-prototype.patch \
            "
 
 SRC_URI[sha256sum] = "4b5da10e94fa3c6195f95222438f63a0234b99ef9df772c7640e82baeaa6e386"