Skip to contentSkip to conversation

package/gdb: add patches for GCC 15.x compatibility

PATCH Applied Thomas Petazzoni via buildroot 2 participants 3 messages May 7, 2025 – May 16, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/gdb: add patches for GCC 15.x compatibility

This commit backports an upstream patch fixing the bundled readline library so that it builds with GCC 15.x.

---
Note: this patch assumes that the 16.x series has been bumped to 16.2 and the 15.x series bumped to 15.2.

---
 ...ne-tcap.h-Update-definitions-for-C23.patch | 52 +++++++++++++++++++
 ...ne-tcap.h-Update-definitions-for-C23.patch | 52 +++++++++++++++++++
 ...ne-tcap.h-Update-definitions-for-C23.patch | 52 +++++++++++++++++++
 3 files changed, 156 insertions(+)
 create mode 100644 package/gdb/14.2/0010-readline-tcap.h-Update-definitions-for-C23.patch
 create mode 100644 package/gdb/15.2/0010-readline-tcap.h-Update-definitions-for-C23.patch
 create mode 100644 package/gdb/16.3/0010-readline-tcap.h-Update-definitions-for-C23.patch
package/gdb/14.2/0010-readline-tcap.h-Update-definitions-for-C23.patch new file +52 -0
new file mode 100644
index 0000000000..50100d8bfc
@@ -0,0 +1,52 @@
+From 0f81e47dff4bddc6ba9c45402821f857251f2b0f Mon Sep 17 00:00:00 2001
+From: Chris Packham <[email protected]>
+Date: Wed, 30 Apr 2025 16:49:44 +1200
+Subject: [PATCH] readline/tcap.h: Update definitions for C23
+
+C23 changes how function definitions like int `int tputs ()` are
+interpreted. In older standards this meant that the function arguments
+are unknown. In C23 this is interpreted as `int tputs (void)` so now
+when we compile with GCC15 (which defaults to -std=gnu23) we get an
+error such as
+
+  readline/display.c:2839:17: error: too many arguments to function 'tputs'; expected 0, have 3
+
+Add the function arguments for tgetent(), tgetflag(), tgetnum(),
+tgetstr(), tputs() and tgoto().
+
+Signed-off-by: Chris Packham <[email protected]>
+Approved-By: Tom Tromey <[email protected]>
+Upstream: 5c87b330e910f8be1443c881fd16a70e685f1f2f
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ readline/readline/tcap.h | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/readline/readline/tcap.h b/readline/readline/tcap.h
+index 859e6eed5aa..9e2ed124e49 100644
+--- a/readline/readline/tcap.h
++++ b/readline/readline/tcap.h
+@@ -46,14 +46,14 @@ extern char *UP, *BC;
+ 
+ extern short ospeed;
+ 
+-extern int tgetent ();
+-extern int tgetflag ();
+-extern int tgetnum ();
+-extern char *tgetstr ();
++extern int tgetent (char *bp, const char *name);
++extern int tgetflag (char *id);
++extern int tgetnum (char *id);
++extern char *tgetstr (char *id, char **area);
+ 
+-extern int tputs ();
++extern int tputs (const char *str, int affcnt, int (*putc)(int));
+ 
+-extern char *tgoto ();
++extern char *tgoto (const char *cap, int col, int row);
+ 
+ #endif /* HAVE_TERMCAP_H */
+ 
+-- 
+2.49.0
+
package/gdb/15.2/0010-readline-tcap.h-Update-definitions-for-C23.patch new file +52 -0

52 lines not on this page · raw message

package/gdb/16.3/0010-readline-tcap.h-Update-definitions-for-C23.patch new file +52 -0

52 lines not on this page · raw message

Signature · 6 lines
2.49.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to Thomas Petazzoni via buildroot
Quoted 4 lines · Thomas Petazzoni via buildroot

This commit backports an upstream patch fixing the bundled readline library so that it builds with GCC 15.x.

Applied to 2025.02.x, thanks.

Regards,
Arnout

Quoted 176 lines

---
Note: this patch assumes that the 16.x series has been bumped to 16.2 and the 15.x series bumped to 15.2.

---
  ...ne-tcap.h-Update-definitions-for-C23.patch | 52 +++++++++++++++++++
  ...ne-tcap.h-Update-definitions-for-C23.patch | 52 +++++++++++++++++++
  ...ne-tcap.h-Update-definitions-for-C23.patch | 52 +++++++++++++++++++
  3 files changed, 156 insertions(+)

create mode 100644 package/gdb/14.2/0010-readline-tcap.h-Update-definitions-for-C23.patch create mode 100644 package/gdb/15.2/0010-readline-tcap.h-Update-definitions-for-C23.patch create mode 100644 package/gdb/16.3/0010-readline-tcap.h-Update-definitions-for-C23.patch

package/gdb/14.2/0010-readline-tcap.h-Update-definitions-for-C23.patch new file +52 -0
new file mode 100644
index 0000000000..50100d8bfc
@@ -0,0 +1,52 @@
+From 0f81e47dff4bddc6ba9c45402821f857251f2b0f Mon Sep 17 00:00:00 2001
+From: Chris Packham <[email protected]>
+Date: Wed, 30 Apr 2025 16:49:44 +1200
+Subject: [PATCH] readline/tcap.h: Update definitions for C23
+
+C23 changes how function definitions like int `int tputs ()` are
+interpreted. In older standards this meant that the function arguments
+are unknown. In C23 this is interpreted as `int tputs (void)` so now
+when we compile with GCC15 (which defaults to -std=gnu23) we get an
+error such as
+
+  readline/display.c:2839:17: error: too many arguments to function 'tputs'; expected 0, have 3
+
+Add the function arguments for tgetent(), tgetflag(), tgetnum(),
+tgetstr(), tputs() and tgoto().
+
+Signed-off-by: Chris Packham <[email protected]>
+Approved-By: Tom Tromey <[email protected]>
+Upstream: 5c87b330e910f8be1443c881fd16a70e685f1f2f
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ readline/readline/tcap.h | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/readline/readline/tcap.h b/readline/readline/tcap.h
+index 859e6eed5aa..9e2ed124e49 100644
+--- a/readline/readline/tcap.h
++++ b/readline/readline/tcap.h
+@@ -46,14 +46,14 @@ extern char *UP, *BC;
+
+ extern short ospeed;
+
+-extern int tgetent ();
+-extern int tgetflag ();
+-extern int tgetnum ();
+-extern char *tgetstr ();
++extern int tgetent (char *bp, const char *name);
++extern int tgetflag (char *id);
++extern int tgetnum (char *id);
++extern char *tgetstr (char *id, char **area);
+
+-extern int tputs ();
++extern int tputs (const char *str, int affcnt, int (*putc)(int));
+
+-extern char *tgoto ();
++extern char *tgoto (const char *cap, int col, int row);
+
+ #endif /* HAVE_TERMCAP_H */
+
+--
+2.49.0
+
package/gdb/15.2/0010-readline-tcap.h-Update-definitions-for-C23.patch new file +52 -0
new file mode 100644
index 0000000000..64f741fe75
@@ -0,0 +1,52 @@
+From 130750cf9607fc1c4bcbead820a27bee6ee60f04 Mon Sep 17 00:00:00 2001
+From: Chris Packham <[email protected]>
+Date: Wed, 30 Apr 2025 16:49:44 +1200
+Subject: [PATCH] readline/tcap.h: Update definitions for C23
+
+C23 changes how function definitions like int `int tputs ()` are
+interpreted. In older standards this meant that the function arguments
+are unknown. In C23 this is interpreted as `int tputs (void)` so now
+when we compile with GCC15 (which defaults to -std=gnu23) we get an
+error such as
+
+  readline/display.c:2839:17: error: too many arguments to function 'tputs'; expected 0, have 3
+
+Add the function arguments for tgetent(), tgetflag(), tgetnum(),
+tgetstr(), tputs() and tgoto().
+
+Signed-off-by: Chris Packham <[email protected]>
+Approved-By: Tom Tromey <[email protected]>
+Upstream: 5c87b330e910f8be1443c881fd16a70e685f1f2f
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ readline/readline/tcap.h | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/readline/readline/tcap.h b/readline/readline/tcap.h
+index 859e6eed5aa..9e2ed124e49 100644
+--- a/readline/readline/tcap.h
++++ b/readline/readline/tcap.h
+@@ -46,14 +46,14 @@ extern char *UP, *BC;
+
+ extern short ospeed;
+
+-extern int tgetent ();
+-extern int tgetflag ();
+-extern int tgetnum ();
+-extern char *tgetstr ();
++extern int tgetent (char *bp, const char *name);
++extern int tgetflag (char *id);
++extern int tgetnum (char *id);
++extern char *tgetstr (char *id, char **area);
+
+-extern int tputs ();
++extern int tputs (const char *str, int affcnt, int (*putc)(int));
+
+-extern char *tgoto ();
++extern char *tgoto (const char *cap, int col, int row);
+
+ #endif /* HAVE_TERMCAP_H */
+
+--
+2.49.0
+
package/gdb/16.3/0010-readline-tcap.h-Update-definitions-for-C23.patch new file +42 -0
new file mode 100644
index 0000000000..c9a34e9a89
@@ -0,0 +1,52 @@
+From f37d1bbe334c751b9bd77fa3a9d9accd93614677 Mon Sep 17 00:00:00 2001
+From: Chris Packham <[email protected]>
+Date: Wed, 30 Apr 2025 16:49:44 +1200
+Subject: [PATCH] readline/tcap.h: Update definitions for C23
+
+C23 changes how function definitions like int `int tputs ()` are
+interpreted. In older standards this meant that the function arguments
+are unknown. In C23 this is interpreted as `int tputs (void)` so now
+when we compile with GCC15 (which defaults to -std=gnu23) we get an
+error such as
+
+  readline/display.c:2839:17: error: too many arguments to function 'tputs'; expected 0, have 3
+
+Add the function arguments for tgetent(), tgetflag(), tgetnum(),
+tgetstr(), tputs() and tgoto().
+
+Signed-off-by: Chris Packham <[email protected]>
+Approved-By: Tom Tromey <[email protected]>
+Upstream: 5c87b330e910f8be1443c881fd16a70e685f1f2f
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ readline/readline/tcap.h | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/readline/readline/tcap.h b/readline/readline/tcap.h
+index 859e6eed5aa..9e2ed124e49 100644
+--- a/readline/readline/tcap.h
++++ b/readline/readline/tcap.h
+@@ -46,14 +46,14 @@ extern char *UP, *BC;
+
+ extern short ospeed;
+
+-extern int tgetent ();
+-extern int tgetflag ();
+-extern int tgetnum ();
+-extern char *tgetstr ();
++extern int tgetent (char *bp, const char *name);
++extern int tgetflag (char *id);
++extern int tgetnum (char *id);
++extern char *tgetstr (char *id, char **area);
+
+-extern int tputs ();

package/gdb/16.3/0010-readline-tcap.h-Update-definitions-for-C23.patch line 52

Quoted 10 lines
package/gdb/16.3/0010-readline-tcap.h-Update-definitions-for-C23.patch new file +10 -0
++extern int tputs (const char *str, int affcnt, int (*putc)(int));
+
+-extern char *tgoto ();
++extern char *tgoto (const char *cap, int col, int row);
+
+ #endif /* HAVE_TERMCAP_H */
+
+--
+2.49.0
+

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot