Skip to content

Commit cc80fbb

Browse files
rsalvaterrarobimarko
authored andcommitted
ppp: fix building with GCC 15.1
Backport two patches in order to fix it. Signed-off-by: Rui Salvaterra <[email protected]> Link: openwrt/openwrt#18600 Signed-off-by: Robert Marko <[email protected]>
1 parent e595214 commit cc80fbb

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
From 5edcb01f1d8d521c819d45df1f1bb87697252130 Mon Sep 17 00:00:00 2001
2+
From: Khem Raj <[email protected]>
3+
Date: Mon, 17 Mar 2025 14:38:26 -0700
4+
Subject: [PATCH] pppd/session: Fixed building with GCC 15
5+
6+
Fixed building with GCC 15 which defaults to C23
7+
and find conflicting declration of getspnam() here
8+
with the one provided by shadow.h (extern struct spwd *getspnam (const char *__name);)
9+
10+
Fixes
11+
../../ppp-2.5.2/pppd/session.c: In function 'session_start':
12+
../../ppp-2.5.2/pppd/session.c:185:18: error: conflicting types for 'getspnam'; have 'struct spwd *(void)'
13+
185 | struct spwd *getspnam();
14+
| ^~~~~~~~
15+
16+
Signed-off-by: Khem Raj <[email protected]>
17+
---
18+
pppd/session.c | 1 -
19+
1 file changed, 1 deletion(-)
20+
21+
--- a/pppd/session.c
22+
+++ b/pppd/session.c
23+
@@ -182,7 +182,6 @@ session_start(const int flags, const cha
24+
char *cbuf;
25+
#ifdef HAVE_SHADOW_H
26+
struct spwd *spwd;
27+
- struct spwd *getspnam();
28+
long now = 0;
29+
#endif /* #ifdef HAVE_SHADOW_H */
30+
#endif /* #ifdef PPP_WITH_PAM */
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
From c6c84c77c16878745be4955f2f5baac1f2280c96 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= <[email protected]>
3+
Date: Thu, 27 Feb 2025 11:44:08 +0100
4+
Subject: [PATCH] Fixed building with GCC 15
5+
MIME-Version: 1.0
6+
Content-Type: text/plain; charset=UTF-8
7+
Content-Transfer-Encoding: 8bit
8+
9+
GCC 15 defaults to C23 which does not allow K&R declarations.
10+
11+
Credit Yaakov Selkowitz in:
12+
https://src.fedoraproject.org/rpms/ppp/pull-request/12
13+
14+
Signed-off-by: Jaroslav Škarvada <[email protected]>
15+
---
16+
pppdump/pppdump.c | 20 +++++++-------------
17+
1 file changed, 7 insertions(+), 13 deletions(-)
18+
19+
--- a/pppdump/pppdump.c
20+
+++ b/pppdump/pppdump.c
21+
@@ -42,14 +42,12 @@ int tot_sent, tot_rcvd;
22+
extern int optind;
23+
extern char *optarg;
24+
25+
-void dumplog();
26+
-void dumpppp();
27+
-void show_time();
28+
+void dumplog(FILE *);
29+
+void dumpppp(FILE *);
30+
+void show_time(FILE *, int);
31+
32+
int
33+
-main(ac, av)
34+
- int ac;
35+
- char **av;
36+
+main(int ac, char **av)
37+
{
38+
int i;
39+
char *p;
40+
@@ -97,8 +95,7 @@ main(ac, av)
41+
}
42+
43+
void
44+
-dumplog(f)
45+
- FILE *f;
46+
+dumplog(FILE *f)
47+
{
48+
int c, n, k, col;
49+
int nb, c2;
50+
@@ -241,8 +238,7 @@ struct pkt {
51+
unsigned char dbuf[8192];
52+
53+
void
54+
-dumpppp(f)
55+
- FILE *f;
56+
+dumpppp(FILE *f)
57+
{
58+
int c, n, k;
59+
int nb, nl, dn, proto, rv;
60+
@@ -375,9 +371,7 @@ dumpppp(f)
61+
}
62+
63+
void
64+
-show_time(f, c)
65+
- FILE *f;
66+
- int c;
67+
+show_time(FILE *f, int c)
68+
{
69+
time_t t;
70+
int n;

0 commit comments

Comments
 (0)