Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Chris Packham <judge.packham@gmail.com>
To: gdb-patches@sourceware.org
Cc: Chris Packham <judge.packham@gmail.com>
Subject: [PATCH] readline/tcap.h: Update definitions for C23
Date: Wed, 30 Apr 2025 16:49:44 +1200	[thread overview]
Message-ID: <20250430044944.1146925-1-judge.packham@gmail.com> (raw)

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>
---
 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


             reply	other threads:[~2025-04-30  4:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-30  4:49 Chris Packham [this message]
2025-04-30 19:30 ` Tom Tromey
2025-04-30 20:44   ` Chris Packham
2025-05-02 18:03     ` Tom Tromey
2025-06-09 17:17 ` Christoph Müllner
2025-06-09 19:46   ` Simon Marchi
2025-06-09 21:43     ` Christoph Müllner
2025-06-10 13:04       ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250430044944.1146925-1-judge.packham@gmail.com \
    --to=judge.packham@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox