From 7709b85f86f7ce2da5a86f2d5d1fcdd77c5089a1 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 1 Jul 2023 11:30:42 -0700 Subject: [PATCH] lua-rs232: fix compilation with GCC13 Patch taken from upstream. Signed-off-by: Rosen Penev --- lang/lua-rs232/Makefile | 2 +- lang/lua-rs232/patches/010-gcc13.patch | 56 ++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 lang/lua-rs232/patches/010-gcc13.patch diff --git a/lang/lua-rs232/Makefile b/lang/lua-rs232/Makefile index 654e21ca11..6d0ec7e4d0 100644 --- a/lang/lua-rs232/Makefile +++ b/lang/lua-rs232/Makefile @@ -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 index 0000000000..32da137622 --- /dev/null +++ b/lang/lua-rs232/patches/010-gcc13.patch @@ -0,0 +1,56 @@ +From 3467c3c354263b066ad47bddfe6eb869c0111e0d Mon Sep 17 00:00:00 2001 +From: Damian Wrobel +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 +--- + 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);