diff mbox series

[v3,1/1] package/cwiid: fix build with gcc >= 14

Message ID 20240723093312.770586-1-fontaine.fabrice@gmail.com
State Accepted
Headers show
Series [v3,1/1] package/cwiid: fix build with gcc >= 14 | expand

Commit Message

Fabrice Fontaine July 23, 2024, 9:33 a.m. UTC
Fix the following build failure with gcc >= 14:

led.c: In function 'wmplugin_exec':
led.c:86:42: error: assignment to 'struct cwiid_btn_message *' from incompatible pointer type 'struct cwiid_btn_mesg *' [-Wincompatible-pointer-types]
   86 |                                 btn_mesg = &mesg[i].btn_mesg;
      |                                          ^

Fixes:
 - http://autobuild.buildroot.org/results/a3bde74ff2137d088f4261e62930859bfe460cb9

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
Changes v2 -> v3:
 - Fix patch number
Changes v1 -> v2 (after review of Thomas Petazzoni):
 - Fix variable declaration instead of adding a wrong cast

 ...gins-led-led.c-fix-build-with-gcc-14.patch | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 package/cwiid/0003-wminput-plugins-led-led.c-fix-build-with-gcc-14.patch

Comments

Thomas Petazzoni July 23, 2024, 9:35 a.m. UTC | #1
Hello Fabrice,

Thanks for the new iteration.

On Tue, 23 Jul 2024 11:33:12 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> new file mode 100644
> index 0000000000..ba8121802b
> --- /dev/null
> +++ b/package/cwiid/0003-wminput-plugins-led-led.c-fix-build-with-gcc-14.patch
> @@ -0,0 +1,37 @@
> +From 10106fdb4cc833faa3c2fcb980d0a4eb121fe19d Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Date: Tue, 23 Jul 2024 10:31:32 +0200
> +Subject: [PATCH] wminput/plugins/led/led.c: fix build with gcc >= 14
> +
> +Fix the following build failure with gcc >= 14:
> +
> +led.c: In function 'wmplugin_exec':
> +led.c:86:42: error: assignment to 'struct cwiid_btn_message *' from incompatible pointer type 'struct cwiid_btn_mesg *' [-Wincompatible-pointer-types]
> +   86 |                                 btn_mesg = &mesg[i].btn_mesg;
> +      |                                          ^
> +
> +Fixes:
> + - http://autobuild.buildroot.org/results/a3bde74ff2137d088f4261e62930859bfe460cb9
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Upstream: https://github.com/abstrakraft/cwiid/pull/47

But is it the right fix this time? (I believe so, but your commit log
doesn't explain why it's the right fix, and what was wrong before).

Thomas
Thomas Petazzoni Aug. 2, 2024, 4:51 p.m. UTC | #2
On Tue, 23 Jul 2024 11:33:12 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Fix the following build failure with gcc >= 14:
> 
> led.c: In function 'wmplugin_exec':
> led.c:86:42: error: assignment to 'struct cwiid_btn_message *' from incompatible pointer type 'struct cwiid_btn_mesg *' [-Wincompatible-pointer-types]
>    86 |                                 btn_mesg = &mesg[i].btn_mesg;
>       |                                          ^
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/a3bde74ff2137d088f4261e62930859bfe460cb9
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> Changes v2 -> v3:
>  - Fix patch number
> Changes v1 -> v2 (after review of Thomas Petazzoni):
>  - Fix variable declaration instead of adding a wrong cast

Applied to master, thanks.

Thomas
Peter Korsgaard Sept. 3, 2024, 4:19 p.m. UTC | #3
>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Fix the following build failure with gcc >= 14:
 > led.c: In function 'wmplugin_exec':
 > led.c:86:42: error: assignment to 'struct cwiid_btn_message *' from incompatible pointer type 'struct cwiid_btn_mesg *' [-Wincompatible-pointer-types]
 >    86 |                                 btn_mesg = &mesg[i].btn_mesg;
 >       |                                          ^

 > Fixes:
 >  - http://autobuild.buildroot.org/results/a3bde74ff2137d088f4261e62930859bfe460cb9

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
 > ---
 > Changes v2 -> v3:
 >  - Fix patch number
 > Changes v1 -> v2 (after review of Thomas Petazzoni):
 >  - Fix variable declaration instead of adding a wrong cast

Committed to 2024.05.x, thanks.
diff mbox series

Patch

diff --git a/package/cwiid/0003-wminput-plugins-led-led.c-fix-build-with-gcc-14.patch b/package/cwiid/0003-wminput-plugins-led-led.c-fix-build-with-gcc-14.patch
new file mode 100644
index 0000000000..ba8121802b
--- /dev/null
+++ b/package/cwiid/0003-wminput-plugins-led-led.c-fix-build-with-gcc-14.patch
@@ -0,0 +1,37 @@ 
+From 10106fdb4cc833faa3c2fcb980d0a4eb121fe19d Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Tue, 23 Jul 2024 10:31:32 +0200
+Subject: [PATCH] wminput/plugins/led/led.c: fix build with gcc >= 14
+
+Fix the following build failure with gcc >= 14:
+
+led.c: In function 'wmplugin_exec':
+led.c:86:42: error: assignment to 'struct cwiid_btn_message *' from incompatible pointer type 'struct cwiid_btn_mesg *' [-Wincompatible-pointer-types]
+   86 |                                 btn_mesg = &mesg[i].btn_mesg;
+      |                                          ^
+
+Fixes:
+ - http://autobuild.buildroot.org/results/a3bde74ff2137d088f4261e62930859bfe460cb9
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Upstream: https://github.com/abstrakraft/cwiid/pull/47
+---
+ wminput/plugins/led/led.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/wminput/plugins/led/led.c b/wminput/plugins/led/led.c
+index 93b96d9..591f365 100644
+--- a/wminput/plugins/led/led.c
++++ b/wminput/plugins/led/led.c
+@@ -72,7 +72,7 @@ struct wmplugin_data *wmplugin_exec(int mesg_count, union cwiid_mesg mesg[])
+ {
+ 	int i;
+ 	uint8_t button;
+-	struct cwiid_btn_message *btn_mesg;
++	struct cwiid_btn_mesg *btn_mesg;
+ 
+ 	uint8_t led_state = (Led1 ? CWIID_LED1_ON : 0)
+ 	                  | (Led2 ? CWIID_LED2_ON : 0)
+-- 
+2.43.0
+