[binutils-gdb/gdb-16-branch] readline/tcap.h: Update definitions for C23

Tom Tromey tromey@sourceware.org
Tue Jun 10 13:06:39 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=800169229d1c69a6d9ad4a6f7b7481aca75eeefb

commit 800169229d1c69a6d9ad4a6f7b7481aca75eeefb
Author: Chris Packham <judge.packham@gmail.com>
Date:   Wed Apr 30 16:49:44 2025 +1200

    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 <judge.packham@gmail.com>
    Approved-By: Tom Tromey <tom@tromey.com>
    (cherry picked from commit 5c87b330e910f8be1443c881fd16a70e685f1f2f)
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33071

Diff:
---
 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 */


More information about the Gdb-cvs mailing list