[openwrt/openwrt] ppp: fix building with GCC 15.1

LEDE Commits lede-commits at lists.infradead.org
Sun Jun 8 03:20:22 PDT 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/cc80fbb0aa16e87da61079eef0a0dcc285745f99

commit cc80fbb0aa16e87da61079eef0a0dcc285745f99
Author: Rui Salvaterra <rsalvaterra at gmail.com>
AuthorDate: Sat Apr 26 11:43:21 2025 +0100

    ppp: fix building with GCC 15.1
    
    Backport two patches in order to fix it.
    
    Signed-off-by: Rui Salvaterra <rsalvaterra at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/18600
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 ...0-pppd-session-fixed-building-with-gcc-15.patch | 30 ++++++++++
 .../001-pppdump-fixed-building-with-gcc-15.patch   | 70 ++++++++++++++++++++++
 2 files changed, 100 insertions(+)

diff --git a/package/network/services/ppp/patches/000-pppd-session-fixed-building-with-gcc-15.patch b/package/network/services/ppp/patches/000-pppd-session-fixed-building-with-gcc-15.patch
new file mode 100644
index 0000000000..6b4f1bd365
--- /dev/null
+++ b/package/network/services/ppp/patches/000-pppd-session-fixed-building-with-gcc-15.patch
@@ -0,0 +1,30 @@
+From 5edcb01f1d8d521c819d45df1f1bb87697252130 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem at gmail.com>
+Date: Mon, 17 Mar 2025 14:38:26 -0700
+Subject: [PATCH] pppd/session: Fixed building with GCC 15
+
+Fixed building with GCC 15 which defaults to C23
+and find conflicting declration of getspnam() here
+with the one provided by shadow.h (extern struct spwd *getspnam (const char *__name);)
+
+Fixes
+../../ppp-2.5.2/pppd/session.c: In function 'session_start':
+../../ppp-2.5.2/pppd/session.c:185:18: error: conflicting types for 'getspnam'; have 'struct spwd *(void)'
+  185 |     struct spwd *getspnam();
+      |                  ^~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem at gmail.com>
+---
+ pppd/session.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/pppd/session.c
++++ b/pppd/session.c
+@@ -182,7 +182,6 @@ session_start(const int flags, const cha
+     char *cbuf;
+ #ifdef HAVE_SHADOW_H
+     struct spwd *spwd;
+-    struct spwd *getspnam();
+     long now = 0;
+ #endif /* #ifdef HAVE_SHADOW_H */
+ #endif /* #ifdef PPP_WITH_PAM */
diff --git a/package/network/services/ppp/patches/001-pppdump-fixed-building-with-gcc-15.patch b/package/network/services/ppp/patches/001-pppdump-fixed-building-with-gcc-15.patch
new file mode 100644
index 0000000000..cd3f670772
--- /dev/null
+++ b/package/network/services/ppp/patches/001-pppdump-fixed-building-with-gcc-15.patch
@@ -0,0 +1,70 @@
+From c6c84c77c16878745be4955f2f5baac1f2280c96 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= <jskarvad at redhat.com>
+Date: Thu, 27 Feb 2025 11:44:08 +0100
+Subject: [PATCH] Fixed building with GCC 15
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+GCC 15 defaults to C23 which does not allow K&R declarations.
+
+Credit Yaakov Selkowitz in:
+https://src.fedoraproject.org/rpms/ppp/pull-request/12
+
+Signed-off-by: Jaroslav Škarvada <jskarvad at redhat.com>
+---
+ pppdump/pppdump.c | 20 +++++++-------------
+ 1 file changed, 7 insertions(+), 13 deletions(-)
+
+--- a/pppdump/pppdump.c
++++ b/pppdump/pppdump.c
+@@ -42,14 +42,12 @@ int tot_sent, tot_rcvd;
+ extern int optind;
+ extern char *optarg;
+ 
+-void dumplog();
+-void dumpppp();
+-void show_time();
++void dumplog(FILE *);
++void dumpppp(FILE *);
++void show_time(FILE *, int);
+ 
+ int
+-main(ac, av)
+-    int ac;
+-    char **av;
++main(int ac, char **av)
+ {
+     int i;
+     char *p;
+@@ -97,8 +95,7 @@ main(ac, av)
+ }
+ 
+ void
+-dumplog(f)
+-    FILE *f;
++dumplog(FILE *f)
+ {
+     int c, n, k, col;
+     int nb, c2;
+@@ -241,8 +238,7 @@ struct pkt {
+ unsigned char dbuf[8192];
+ 
+ void
+-dumpppp(f)
+-    FILE *f;
++dumpppp(FILE *f)
+ {
+     int c, n, k;
+     int nb, nl, dn, proto, rv;
+@@ -375,9 +371,7 @@ dumpppp(f)
+ }
+ 
+ void
+-show_time(f, c)
+-    FILE *f;
+-    int c;
++show_time(FILE *f, int c)
+ {
+     time_t t;
+     int n;




More information about the lede-commits mailing list