cligen: fix compilation with GCC 15
authorRosen Penev <rosenp@gmail.com>
Sat, 12 Jul 2025 03:23:36 +0000 (20:23 -0700)
committerPhilip Prindeville <philipp@redfish-solutions.com>
Sun, 13 Jul 2025 21:24:12 +0000 (15:24 -0600)
Upstream has this fixed in a massive patch.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
utils/cligen/Makefile
utils/cligen/patches/010-gcc15.patch [new file with mode: 0644]

index ff8f63275eb44641beef665e6677741bfba6dde0..e36ea7797765750363d75b2bfcc3ed2c22b158fb 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=cligen
 PKG_VERSION:=7.4.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/clicon/$(PKG_NAME)/tar.gz/$(PKG_VERSION)?
diff --git a/utils/cligen/patches/010-gcc15.patch b/utils/cligen/patches/010-gcc15.patch
new file mode 100644 (file)
index 0000000..6d257b7
--- /dev/null
@@ -0,0 +1,50 @@
+--- a/cligen_getline.c
++++ b/cligen_getline.c
+@@ -41,12 +41,12 @@
+ /********************* exported variables ********************************/
+-int (*gl_in_hook)() = NULL;
+-int (*gl_out_hook)() = NULL;
+-int (*gl_tab_hook)() = NULL;
+-int (*gl_qmark_hook)() = NULL;
+-int (*gl_susp_hook)() = NULL;
+-int (*gl_interrupt_hook)() = NULL;
++int (*gl_in_hook)(void *, char *) = NULL;
++int (*gl_out_hook)(void *, char *) = NULL;
++int (*gl_tab_hook)(cligen_handle, int *) = NULL;
++int (*gl_qmark_hook)(cligen_handle, char *) = NULL;
++int (*gl_susp_hook)(void *, char *, int, int *) = NULL;
++int (*gl_interrupt_hook)(cligen_handle) = NULL;
+ /******************** internal interface *********************************/
+@@ -55,7 +55,7 @@ static void     gl_init1(void);
+ static void     gl_cleanup(void);       /* to undo gl_init1 */
+ void            gl_char_init(void);     /* get ready for no echo input */
+ void            gl_char_cleanup(void);  /* undo gl_char_init */
+-static size_t   (*gl_strlen)(const char *) = (size_t(*)())strlen;
++static size_t (*gl_strlen)(const char *) = strlen;
+                                         /* returns printable prompt width */
+ static int      gl_addchar(cligen_handle h, int c);     /* install specified char */
+@@ -1409,7 +1409,7 @@ gl_fixup(cligen_handle h,
+ /******************* strlen stuff **************************************/
+ void
+-gl_strwidth(size_t (*func)())
++gl_strwidth(size_t (*func)(const char *))
+ {
+     if (func != 0) {
+         gl_strlen = func;
+--- a/cligen_getline.h
++++ b/cligen_getline.h
+@@ -23,7 +23,7 @@
+ /*
+  * Types
+  */
+-typedef size_t (*gl_strwidth_proc)(char *);
++typedef size_t (*gl_strwidth_proc)(const char *);
+ /*
+  * Prototypes