lua-rs232: fix compilation with GCC13
authorRosen Penev <rosenp@gmail.com>
Sat, 1 Jul 2023 18:30:42 +0000 (11:30 -0700)
committerRosen Penev <rosenp@gmail.com>
Tue, 11 Jul 2023 02:51:31 +0000 (19:51 -0700)
Patch taken from upstream.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
lang/lua-rs232/Makefile
lang/lua-rs232/patches/010-gcc13.patch [new file with mode: 0644]

index 654e21ca1172ada28c35bf4bd4295ad062c2ca23..6d0ec7e4d0886b9f73c243311432c34ae158e461 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=lua-rs232
 PKG_SOURCE_DATE:=2019-11-20
 PKG_SOURCE_VERSION:=c106c94d1a5a84e8582c936528303528608776c2
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/srdgame/librs232
diff --git a/lang/lua-rs232/patches/010-gcc13.patch b/lang/lua-rs232/patches/010-gcc13.patch
new file mode 100644 (file)
index 0000000..32da137
--- /dev/null
@@ -0,0 +1,56 @@
+From 3467c3c354263b066ad47bddfe6eb869c0111e0d Mon Sep 17 00:00:00 2001
+From: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
+Date: Tue, 24 Jan 2023 10:19:16 +0100
+Subject: [PATCH] Fix rs232_set_* prototypes mismatch
+
+Fixes compilation error on gcc 13 (excerpt):
+ rs232_posix.c:490:1: error: conflicting types for 'rs232_set_baud' \
+   due to enum/integer mismatch; have 'unsigned int(struct rs232_port_t *, \
+   enum rs232_baud_e)' [-Werror=enum-int-mismatch]
+  490 | rs232_set_baud(struct rs232_port_t *p, enum rs232_baud_e baud)
+      | ^~~~~~~~~~~~~~
+ In file included from rs232_posix.c:39:
+ ../include/librs232/rs232.h:203:24: note: previous declaration of \
+   'rs232_set_baud' with type 'unsigned int(struct rs232_port_t *, unsigned int)'
+  203 | RS232_LIB unsigned int rs232_set_baud(struct rs232_port_t *p, unsigned int baud);
+      |                        ^~~~~~~~~~~~~~
+
+ rs232_posix.c:591:1: error: conflicting types for 'rs232_set_dtr' \
+  due to enum/integer mismatch; have 'unsigned int(struct rs232_port_t *, \
+  enum rs232_dtr_e)' [-Werror=enum-int-mismatch]
+  591 | rs232_set_dtr(struct rs232_port_t *p, enum rs232_dtr_e state)
+      | ^~~~~~~~~~~~~
+ In file included from rs232_posix.c:39:
+  ../include/librs232/rs232.h:208:24: note: previous declaration of 'rs232_set_dtr' \
+  with type 'unsigned int(struct rs232_port_t *, unsigned int)'
+  208 | RS232_LIB unsigned int rs232_set_dtr(struct rs232_port_t *p, unsigned int dtr);
+      |                        ^~~~~~~~~~~~~
+
+Signed-off-by: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
+---
+ include/librs232/rs232.h | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+--- a/include/librs232/rs232.h
++++ b/include/librs232/rs232.h
+@@ -200,13 +200,13 @@ RS232_LIB unsigned int rs232_port_open(s
+ RS232_LIB unsigned int rs232_close(struct rs232_port_t *p);
+ RS232_LIB unsigned int rs232_flush(struct rs232_port_t *p);
+ RS232_LIB void rs232_set_device(struct rs232_port_t *p, const char *device);
+-RS232_LIB unsigned int rs232_set_baud(struct rs232_port_t *p, unsigned int baud);
+-RS232_LIB unsigned int rs232_set_stop(struct rs232_port_t *p, unsigned int stop);
+-RS232_LIB unsigned int rs232_set_data(struct rs232_port_t *p, unsigned int data);
+-RS232_LIB unsigned int rs232_set_parity(struct rs232_port_t *p, unsigned int parity);
+-RS232_LIB unsigned int rs232_set_flow(struct rs232_port_t *p, unsigned int flow);
+-RS232_LIB unsigned int rs232_set_dtr(struct rs232_port_t *p, unsigned int dtr);
+-RS232_LIB unsigned int rs232_set_rts(struct rs232_port_t *p, unsigned int rts);
++RS232_LIB unsigned int rs232_set_baud(struct rs232_port_t *p, enum rs232_baud_e baud);
++RS232_LIB unsigned int rs232_set_stop(struct rs232_port_t *p, enum rs232_stop_e stop);
++RS232_LIB unsigned int rs232_set_data(struct rs232_port_t *p, enum rs232_data_e data);
++RS232_LIB unsigned int rs232_set_parity(struct rs232_port_t *p, enum rs232_parity_e parity);
++RS232_LIB unsigned int rs232_set_flow(struct rs232_port_t *p, enum rs232_flow_e flow);
++RS232_LIB unsigned int rs232_set_dtr(struct rs232_port_t *p, enum rs232_dtr_e state);
++RS232_LIB unsigned int rs232_set_rts(struct rs232_port_t *p, enum rs232_rts_e state);
+ RS232_LIB const char * rs232_get_device(struct rs232_port_t *p);
+ RS232_LIB unsigned int rs232_get_baud(struct rs232_port_t *p);
+ RS232_LIB unsigned int rs232_get_stop(struct rs232_port_t *p);