summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHauke Mehrtens2025-05-02 23:12:59 +0000
committerHauke Mehrtens2025-05-03 20:04:13 +0000
commitb77684d2c1897c27da5718b7a18b6f9ad3e41bc1 (patch)
treed084556e583f60e9919536df4798f47c202695b9
parente8cfa339feed4ca8328ef863dc8a8af67509c7ad (diff)
downloadopenwrt-b77684d2c1897c27da5718b7a18b6f9ad3e41bc1.tar.gz
dns320l-mcu: Fix compilation with GCC 14
This fixes the following compile problem: ``` dns320l-daemon.c: In function 'main': dns320l-daemon.c:740:18: error: implicit declaration of function 'isprint' [-Wimplicit-function-declaration] 740 | else if (isprint (optopt)) | ^~~~~~~ dns320l-daemon.c:50:1: note: include '<ctype.h>' or provide a declaration of 'isprint' 49 | #include "dns320l-daemon.h" +++ |+#include <ctype.h> 50 | dns320l-daemon.c:799:5: error: implicit declaration of function 'umask' [-Wimplicit-function-declaration] 799 | umask(0); | ^~~~~ dns320l-daemon.c:864:5: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch] 864 | return; | ^~~~~~ dns320l-daemon.c:691:5: note: declared here 691 | int main(int argc, char *argv[]) | ^~~~ ``` Link: https://github.com/openwrt/openwrt/pull/18688 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--package/utils/dns320l-mcu/Makefile2
-rw-r--r--package/utils/dns320l-mcu/patches/010-gcc-14-fixes.patch50
2 files changed, 51 insertions, 1 deletions
diff --git a/package/utils/dns320l-mcu/Makefile b/package/utils/dns320l-mcu/Makefile
index 9488096a16..042cce7409 100644
--- a/package/utils/dns320l-mcu/Makefile
+++ b/package/utils/dns320l-mcu/Makefile
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=dns320l-mcu
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/wigyori/dns320l-daemon.git
diff --git a/package/utils/dns320l-mcu/patches/010-gcc-14-fixes.patch b/package/utils/dns320l-mcu/patches/010-gcc-14-fixes.patch
new file mode 100644
index 0000000000..dfda9c3710
--- /dev/null
+++ b/package/utils/dns320l-mcu/patches/010-gcc-14-fixes.patch
@@ -0,0 +1,50 @@
+dns320l-mcu: Fix compilation with GCC 14
+
+This fixes the following compile problem:
+```
+dns320l-daemon.c: In function 'main':
+dns320l-daemon.c:740:18: error: implicit declaration of function 'isprint' [-Wimplicit-function-declaration]
+ 740 | else if (isprint (optopt))
+ | ^~~~~~~
+dns320l-daemon.c:50:1: note: include '<ctype.h>' or provide a declaration of 'isprint'
+ 49 | #include "dns320l-daemon.h"
+ +++ |+#include <ctype.h>
+ 50 |
+dns320l-daemon.c:799:5: error: implicit declaration of function 'umask' [-Wimplicit-function-declaration]
+ 799 | umask(0);
+ | ^~~~~
+dns320l-daemon.c:864:5: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
+ 864 | return;
+ | ^~~~~~
+dns320l-daemon.c:691:5: note: declared here
+ 691 | int main(int argc, char *argv[])
+ | ^~~~
+```
+
+--- a/dns320l-daemon.c
++++ b/dns320l-daemon.c
+@@ -26,6 +26,7 @@
+
+ */
+
++#include <ctype.h>
+ #include <errno.h>
+ #include <termios.h>
+ #include <unistd.h>
+@@ -39,6 +40,7 @@
+ #include <sys/ioctl.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
++#include <sys/stat.h>
+ #include <time.h>
+ #include <arpa/inet.h>
+ #include <netinet/in.h>
+@@ -861,7 +863,7 @@ int main(int argc, char *argv[])
+ if (fd < 0)
+ {
+ syslog(LOG_ERR, "error %d opening %s: %s", errno, stDaemonConfig.portName, strerror (errno));
+- return;
++ return EXIT_FAILURE;
+ }
+
+ set_interface_attribs (fd, B115200, 0); // set speed to 115,200 bps, 8n1 (no parity)