diff mbox series

[meta-oe] iftop: fix build with gcc-15

Message ID 20250321093742.634012-1-martin.jansa@gmail.com
State Accepted
Headers show
Series [meta-oe] iftop: fix build with gcc-15 | expand

Commit Message

Martin Jansa March 21, 2025, 9:37 a.m. UTC
From: Martin Jansa <martin.jansa@gmail.com>

fixes:
http://errors.yoctoproject.org/Errors/Details/848458/

Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
---
 .../0001-cfgfile-fix-build-with-gcc-15.patch  | 46 +++++++++++++++++++
 .../recipes-support/iftop/iftop_1.0pre4.bb    |  1 +
 2 files changed, 47 insertions(+)
 create mode 100644 meta-networking/recipes-support/iftop/iftop/0001-cfgfile-fix-build-with-gcc-15.patch
diff mbox series

Patch

diff --git a/meta-networking/recipes-support/iftop/iftop/0001-cfgfile-fix-build-with-gcc-15.patch b/meta-networking/recipes-support/iftop/iftop/0001-cfgfile-fix-build-with-gcc-15.patch
new file mode 100644
index 0000000000..73540e18c6
--- /dev/null
+++ b/meta-networking/recipes-support/iftop/iftop/0001-cfgfile-fix-build-with-gcc-15.patch
@@ -0,0 +1,46 @@ 
+From e579fbe1f73dc89e2bf81a5b6c949f8ae24f93b2 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <martin.jansa@gmail.com>
+Date: Fri, 21 Mar 2025 09:31:05 +0000
+Subject: [PATCH] cfgfile: fix build with gcc-15
+
+* fix read_config declaration to match
+
+cfgfile.c:247:5: error: conflicting types for 'read_config'; have 'int(char *, int)'
+  247 | int read_config(char *file, int whinge_on_error) {
+      |     ^~~~~~~~~~~
+In file included from cfgfile.c:16:
+cfgfile.h:16:5: note: previous declaration of 'read_config' with type 'int(void)'
+   16 | int read_config();
+      |     ^~~~~~~~~~~
+make[2]: *** [Makefile:566: cfgfile.o] Error 1
+make[2]: *** Waiting for unfinished jobs....
+iftop.c: In function 'main':
+iftop.c:803:5: error: too many arguments to function 'read_config'; expected 0, have 2
+  803 |     read_config(options.config_file, options.config_file_specified);
+      |     ^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
+In file included from iftop.c:50:
+cfgfile.h:16:5: note: declared here
+   16 | int read_config();
+      |     ^~~~~~~~~~~
+
+Upstream-Status: Pending [last pre release was over 10 years ago and https://code.blinkace.com/pdw/iftop has last commit from 4 years ago]
+
+Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
+---
+
+ cfgfile.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cfgfile.h b/cfgfile.h
+index 11ba475..a331b75 100644
+--- a/cfgfile.h
++++ b/cfgfile.h
+@@ -13,7 +13,7 @@ typedef struct {
+     int value;
+ } config_enumeration_type;
+ 
+-int read_config();
++int read_config(char *file, int whinge_on_error);
+ 
+ char *config_get_string(const char *directive);
+ int config_get_bool(const char *directive);
diff --git a/meta-networking/recipes-support/iftop/iftop_1.0pre4.bb b/meta-networking/recipes-support/iftop/iftop_1.0pre4.bb
index 517d781281..4d9fea58e0 100644
--- a/meta-networking/recipes-support/iftop/iftop_1.0pre4.bb
+++ b/meta-networking/recipes-support/iftop/iftop_1.0pre4.bb
@@ -8,6 +8,7 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=76498170798db0f4f0fb685a225f702f"
 
 SRC_URI = "http://www.ex-parrot.com/pdw/iftop/download/iftop-${PV}.tar.gz \
            file://iftop-1.0-gcc10.patch \
+           file://0001-cfgfile-fix-build-with-gcc-15.patch \
           "
 SRC_URI[md5sum] = "7e6decb4958e8a4890cccac335239f24"
 SRC_URI[sha256sum] = "f733eeea371a7577f8fe353d86dd88d16f5b2a2e702bd96f5ffb2c197d9b4f97"