Skip to contentSkip to conversation

xfwm4: fix gcc -Wincompatible-pointer-types

PATCH Superseded [email protected] 2 participants 3 messages Jun 10, 2024 – Jun 12, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfwm4: fix gcc -Wincompatible-pointer-types

From: Kai Kang <[email protected]>

Fix xfwm4 incompatible pointer type error with gcc option -Wincompatible-pointer-types:

| ../../xfwm4-4.18.0/src/startup_notification.c:139:57: error: passing argument
2 of 'sn_startup_sequence_get_last_active_time' from incompatible pointer type [-Wincompatible-pointer-types]

|   139 |     sn_startup_sequence_get_last_active_time (sequence, &l_sec, &l_usec);
|       |                                                         ^~~~~~
|       |                                                         |
|       |                                                         long int *
---
 ...-fix-incompatible-pointer-type-error.patch | 34 +++++++++++++++++++
 meta-xfce/recipes-xfce/xfwm4/xfwm4_4.18.0.bb  |  2 ++
 2 files changed, 36 insertions(+)
 create mode 100644 meta-xfce/recipes-xfce/xfwm4/xfwm4/xfwm4-fix-incompatible-pointer-type-error.patch
meta-xfce/recipes-xfce/xfwm4/xfwm4/xfwm4-fix-incompatible-pointer-type-error.patch new file +34 -0
new file mode 100644
index 000000000..eb8fa7c43
@@ -0,0 +1,34 @@
+Fix xfwm4 incompatible pointer type error:
+
+| ../../xfwm4-4.18.0/src/startup_notification.c:139:57: error: passing argument 2 of 'sn_startup_sequence_get_last_active_time' from incompatible pointer type [-Wincompatible-pointer-types]
+|   139 |     sn_startup_sequence_get_last_active_time (sequence, &l_sec, &l_usec);
+|       |                                                         ^~~~~~
+|       |                                                         |
+|       |                                                         long int *
+| In file included from .../usr/include/startup-notification-1.0/libsn/sn.h:32,
+|                  from ../../xfwm4-4.18.0/src/startup_notification.c:33:
+| .../usr/include/startup-notification-1.0/libsn/sn-monitor.h:84:79: note: expected 'time_t *' {aka 'long long int *'} but argument is of type 'long int *'
+|    84 |                                                            time_t            *tv_sec,
+|       |                                                            ~~~~~~~~~~~~~~~~~~~^~~~~~
+
+Upsteam-Status: Submitted [https://gitlab.xfce.org/xfce/xfwm4/-/issues/790]
+
+Signed-off-by: Kai Kang <[email protected]>
+
+---
+ src/startup_notification.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/startup_notification.c b/src/startup_notification.c
+index 2a08cad..05434ca 100644
+--- a/src/startup_notification.c
++++ b/src/startup_notification.c
+@@ -136,7 +136,7 @@ sn_collect_timed_out_foreach (void *element, void *data)
+ 
+     sequence = element;
+     ctod = (CollectTimedOutData *) data;
+-    sn_startup_sequence_get_last_active_time (sequence, &l_sec, &l_usec);
++    sn_startup_sequence_get_last_active_time (sequence, (time_t *)&l_sec, &l_usec);
+     tv_sec = l_sec; tv_usec = l_usec;
+ 
+     elapsed = ((double) ctod->now - (tv_sec * G_USEC_PER_SEC) - tv_usec)
meta-xfce/recipes-xfce/xfwm4/xfwm4_4.18.0.bb +2 -0
index 839f1c870..2770829e9 100644
@@ -8,6 +8,8 @@ inherit xfce update-alternatives features_check
 
 REQUIRED_DISTRO_FEATURES = "x11"
 
+SRC_URI += "file://xfwm4-fix-incompatible-pointer-type-error.patch"
+
 SRC_URI[sha256sum] = "92cd1b889bb25cb4bc06c1c6736c238d96e79c1e706b9f77fad0a89d6e5fc13f"
 
 PACKAGECONFIG ?= " \
Signature · 1 line
2.34.1
#1 lore raw
Quoted 31 lines · Kai Kang via lists.openembedded.org

From: Kai Kang <[email protected]>

Fix xfwm4 incompatible pointer type error with gcc option -Wincompatible-pointer-types:

| ../../xfwm4-4.18.0/src/startup_notification.c:139:57: error: passing argument
2 of 'sn_startup_sequence_get_last_active_time' from incompatible pointer type [-Wincompatible-pointer-types]

|   139 |     sn_startup_sequence_get_last_active_time (sequence, &l_sec, &l_usec);
|       |                                                         ^~~~~~
|       |                                                         |
|       |                                                         long int *
---
 ...-fix-incompatible-pointer-type-error.patch | 34 +++++++++++++++++++
 meta-xfce/recipes-xfce/xfwm4/xfwm4_4.18.0.bb  |  2 ++
 2 files changed, 36 insertions(+)
 create mode 100644 meta-xfce/recipes-xfce/xfwm4/xfwm4/xfwm4-fix-incompatible-pointer-type-error.patch
meta-xfce/recipes-xfce/xfwm4/xfwm4/xfwm4-fix-incompatible-pointer-type-error.patch new file +5 -0
new file mode 100644
index 000000000..eb8fa7c43
@@ -0,0 +1,34 @@
+Fix xfwm4 incompatible pointer type error:
+
+| ../../xfwm4-4.18.0/src/startup_notification.c:139:57: error: passing argument 2 of 'sn_startup_sequence_get_last_active_time' from incompatible pointer type [-Wincompatible-pointer-types]
+|   139 |     sn_startup_sequence_get_last_active_time (sequence, &l_sec, &l_usec);
+|       |                                                         ^~~~~~

meta-xfce/recipes-xfce/xfwm4/xfwm4/xfwm4-fix-incompatible-pointer-type-error.patch line 15

Quoted 10 lines
meta-xfce/recipes-xfce/xfwm4/xfwm4/xfwm4-fix-incompatible-pointer-type-error.patch new file +10 -0
+|       |                                                         |
+|       |                                                         long int *
+| In file included from .../usr/include/startup-notification-1.0/libsn/sn.h:32,
+|                  from ../../xfwm4-4.18.0/src/startup_notification.c:33:
+| .../usr/include/startup-notification-1.0/libsn/sn-monitor.h:84:79: note: expected 'time_t *' {aka 'long long int *'} but argument is of type 'long int *'
+|    84 |                                                            time_t            *tv_sec,
+|       |                                                            ~~~~~~~~~~~~~~~~~~~^~~~~~
+
+Upsteam-Status: Submitted [https://gitlab.xfce.org/xfce/xfwm4/-/issues/790]
+

there is a typo here it should be Upstream

Quoted 44 lines
meta-xfce/recipes-xfce/xfwm4/xfwm4/xfwm4-fix-incompatible-pointer-type-error.patch new file +19 -0
+Signed-off-by: Kai Kang <[email protected]>
+
+---
+ src/startup_notification.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/startup_notification.c b/src/startup_notification.c
+index 2a08cad..05434ca 100644
+--- a/src/startup_notification.c
++++ b/src/startup_notification.c
+@@ -136,7 +136,7 @@ sn_collect_timed_out_foreach (void *element, void *data)
+
+     sequence = element;
+     ctod = (CollectTimedOutData *) data;
+-    sn_startup_sequence_get_last_active_time (sequence, &l_sec, &l_usec);
++    sn_startup_sequence_get_last_active_time (sequence, (time_t *)&l_sec, &l_usec);
+     tv_sec = l_sec; tv_usec = l_usec;
+
+     elapsed = ((double) ctod->now - (tv_sec * G_USEC_PER_SEC) - tv_usec)
meta-xfce/recipes-xfce/xfwm4/xfwm4_4.18.0.bb +2 -1
index 839f1c870..2770829e9 100644
@@ -8,6 +8,8 @@ inherit xfce update-alternatives features_check
 
 REQUIRED_DISTRO_FEATURES = "x11"
 
+SRC_URI += "file://xfwm4-fix-incompatible-pointer-type-error.patch"
+
 SRC_URI[sha256sum] = "92cd1b889bb25cb4bc06c1c6736c238d96e79c1e706b9f77fad0a89d6e5fc13f"
 
 PACKAGECONFIG ?= " \
--

2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#110796): https://lists.openembedded.org/g/openembedded-devel/message/110796
Mute This Topic: https://lists.openembedded.org/mt/106590506/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

author
#2 lore raw
Quoted 35 lines · Khem Raj
Quoted 33 lines · Kai Kang via lists.openembedded.org

From: Kai Kang<[email protected]>

Fix xfwm4 incompatible pointer type error with gcc option -Wincompatible-pointer-types:

| ../../xfwm4-4.18.0/src/startup_notification.c:139:57: error: passing argument
2 of 'sn_startup_sequence_get_last_active_time' from incompatible pointer type [-Wincompatible-pointer-types]

|   139 |     sn_startup_sequence_get_last_active_time (sequence, &l_sec, &l_usec);
|       |                                                         ^~~~~~
|       |                                                         |
|       |                                                         long int *
---
  ...-fix-incompatible-pointer-type-error.patch | 34 +++++++++++++++++++
  meta-xfce/recipes-xfce/xfwm4/xfwm4_4.18.0.bb  |  2 ++
  2 files changed, 36 insertions(+)

create mode 100644 meta-xfce/recipes-xfce/xfwm4/xfwm4/xfwm4-fix-incompatible-pointer-type-error.patch

meta-xfce/recipes-xfce/xfwm4/xfwm4/xfwm4-fix-incompatible-pointer-type-error.patch new file +8 -0
new file mode 100644
index 000000000..eb8fa7c43
@@ -0,0 +1,34 @@
+Fix xfwm4 incompatible pointer type error:
+
+| ../../xfwm4-4.18.0/src/startup_notification.c:139:57: error: passing argument 2 of 'sn_startup_sequence_get_last_active_time' from incompatible pointer type [-Wincompatible-pointer-types]
+|   139 |     sn_startup_sequence_get_last_active_time (sequence, &l_sec, &l_usec);
+|       |                                                         ^~~~~~
+|       |                                                         |
+|       |                                                         long int *
+| In file included from .../usr/include/startup-notification-1.0/libsn/sn.h:32,
Quoted 8 lines

meta-xfce/recipes-xfce/xfwm4/xfwm4/xfwm4-fix-incompatible-pointer-type-error.patch line 15

Quoted 7 lines
meta-xfce/recipes-xfce/xfwm4/xfwm4/xfwm4-fix-incompatible-pointer-type-error.patch new file +7 -0
+|                  from ../../xfwm4-4.18.0/src/startup_notification.c:33:
+| .../usr/include/startup-notification-1.0/libsn/sn-monitor.h:84:79: note: expected 'time_t *' {aka 'long long int *'} but argument is of type 'long int *'
+|    84 |                                                            time_t            *tv_sec,
+|       |                                                            ~~~~~~~~~~~~~~~~~~~^~~~~~
+
+Upsteam-Status: Submitted [https://gitlab.xfce.org/xfce/xfwm4/-/issues/790]
+

there is a typo here it should be Upstream

Sorry for the typo. And finally I find that a patch of startup-notification in oe-core which is backported from maillist causes the issue. I'll update Upstream-Status with that.

Regards, Kai

Quoted 45 lines
Quoted 45 lines
meta-xfce/recipes-xfce/xfwm4/xfwm4/xfwm4-fix-incompatible-pointer-type-error.patch new file +19 -0
+Signed-off-by: Kai Kang<[email protected]>
+
+---
+ src/startup_notification.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/startup_notification.c b/src/startup_notification.c
+index 2a08cad..05434ca 100644
+--- a/src/startup_notification.c
++++ b/src/startup_notification.c
+@@ -136,7 +136,7 @@ sn_collect_timed_out_foreach (void *element, void *data)
+
+     sequence = element;
+     ctod = (CollectTimedOutData *) data;
+-    sn_startup_sequence_get_last_active_time (sequence, &l_sec, &l_usec);
++    sn_startup_sequence_get_last_active_time (sequence, (time_t *)&l_sec, &l_usec);
+     tv_sec = l_sec; tv_usec = l_usec;
+
+     elapsed = ((double) ctod->now - (tv_sec * G_USEC_PER_SEC) - tv_usec)
meta-xfce/recipes-xfce/xfwm4/xfwm4_4.18.0.bb +2 -1
index 839f1c870..2770829e9 100644
@@ -8,6 +8,8 @@ inherit xfce update-alternatives features_check
 
  REQUIRED_DISTRO_FEATURES = "x11"
 
+SRC_URI +="file://xfwm4-fix-incompatible-pointer-type-error.patch"
+
  SRC_URI[sha256sum] = "92cd1b889bb25cb4bc06c1c6736c238d96e79c1e706b9f77fad0a89d6e5fc13f"
 
  PACKAGECONFIG ?= " \
--

2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#110796):https://lists.openembedded.org/g/openembedded-devel/message/110796 Mute This Topic:https://lists.openembedded.org/mt/106590506/1997914
Group Owner:[email protected] Unsubscribe:https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 2 lines
Kai Kang
Wind River Linux