* [PATCH] readline/tcap.h: Update definitions for C23
@ 2025-04-30 4:49 Chris Packham
2025-04-30 19:30 ` Tom Tromey
2025-06-09 17:17 ` Christoph Müllner
0 siblings, 2 replies; 8+ messages in thread
From: Chris Packham @ 2025-04-30 4:49 UTC (permalink / raw)
To: gdb-patches; +Cc: Chris Packham
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] readline/tcap.h: Update definitions for C23
2025-04-30 4:49 [PATCH] readline/tcap.h: Update definitions for C23 Chris Packham
@ 2025-04-30 19:30 ` Tom Tromey
2025-04-30 20:44 ` Chris Packham
2025-06-09 17:17 ` Christoph Müllner
1 sibling, 1 reply; 8+ messages in thread
From: Tom Tromey @ 2025-04-30 19:30 UTC (permalink / raw)
To: Chris Packham; +Cc: gdb-patches
>>>>> "Chris" == Chris Packham <judge.packham@gmail.com> writes:
Chris> C23 changes how function definitions like int `int tputs ()` are
Chris> interpreted. In older standards this meant that the function arguments
Chris> are unknown. In C23 this is interpreted as `int tputs (void)` so now
Chris> when we compile with GCC15 (which defaults to -std=gnu23) we get an
Chris> error such as
I don't have any issue with this patch but would you mind submitting it
to the bug-readline list first?
If you already did, super, just let me know.
thanks,
Tom
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] readline/tcap.h: Update definitions for C23
2025-04-30 19:30 ` Tom Tromey
@ 2025-04-30 20:44 ` Chris Packham
2025-05-02 18:03 ` Tom Tromey
0 siblings, 1 reply; 8+ messages in thread
From: Chris Packham @ 2025-04-30 20:44 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
Hi Tom,
On Thu, May 1, 2025 at 7:30 AM Tom Tromey <tom@tromey.com> wrote:
>
> >>>>> "Chris" == Chris Packham <judge.packham@gmail.com> writes:
>
> Chris> C23 changes how function definitions like int `int tputs ()` are
> Chris> interpreted. In older standards this meant that the function arguments
> Chris> are unknown. In C23 this is interpreted as `int tputs (void)` so now
> Chris> when we compile with GCC15 (which defaults to -std=gnu23) we get an
> Chris> error such as
>
> I don't have any issue with this patch but would you mind submitting it
> to the bug-readline list first?
>
> If you already did, super, just let me know.
>
Have now (just sent the same patch). Although after doing so I note
that tcap.h already has the update in readline-8.3-alpha so maybe the
gdb change should just be to update to that version?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] readline/tcap.h: Update definitions for C23
2025-04-30 20:44 ` Chris Packham
@ 2025-05-02 18:03 ` Tom Tromey
0 siblings, 0 replies; 8+ messages in thread
From: Tom Tromey @ 2025-05-02 18:03 UTC (permalink / raw)
To: Chris Packham; +Cc: Tom Tromey, gdb-patches
>>>>> "Chris" == Chris Packham <judge.packham@gmail.com> writes:
Chris> Have now (just sent the same patch). Although after doing so I note
Chris> that tcap.h already has the update in readline-8.3-alpha so maybe the
Chris> gdb change should just be to update to that version?
Thanks for doing that.
I think we probably shouldn't import an alpha version.
I'm going to check in your proposed patch for now.
When readline 8.3 is released, hopefully one of us will notice and
update to it...
Tom
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] readline/tcap.h: Update definitions for C23
2025-04-30 4:49 [PATCH] readline/tcap.h: Update definitions for C23 Chris Packham
2025-04-30 19:30 ` Tom Tromey
@ 2025-06-09 17:17 ` Christoph Müllner
2025-06-09 19:46 ` Simon Marchi
1 sibling, 1 reply; 8+ messages in thread
From: Christoph Müllner @ 2025-06-09 17:17 UTC (permalink / raw)
To: mailing-list, gdb-patches, Chris Packham, Tom Tromey
Cc: Christoph Müllner
This patch from Apr 30, 2025 landed as 5c87b330e91 on master.
Would it be possible to apply it to gdb-16-branch as well?
The patch applies cleanly.
Thanks,
Christoph
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] readline/tcap.h: Update definitions for C23
2025-06-09 17:17 ` Christoph Müllner
@ 2025-06-09 19:46 ` Simon Marchi
2025-06-09 21:43 ` Christoph Müllner
0 siblings, 1 reply; 8+ messages in thread
From: Simon Marchi @ 2025-06-09 19:46 UTC (permalink / raw)
To: Christoph Müllner, mailing-list, gdb-patches, Chris Packham,
Tom Tromey
On 6/9/25 1:17 PM, Christoph Müllner wrote:
> This patch from Apr 30, 2025 landed as 5c87b330e91 on master.
> Would it be possible to apply it to gdb-16-branch as well?
> The patch applies cleanly.
>
> Thanks,
> Christoph
There (probably) won't be any more GDB 16 releases, but I think it can
be useful for some people to backport the patch anyway. We need to have
a Bugzilla PR number first (if there isn't one already).
Simon
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] readline/tcap.h: Update definitions for C23
2025-06-09 19:46 ` Simon Marchi
@ 2025-06-09 21:43 ` Christoph Müllner
2025-06-10 13:04 ` Tom Tromey
0 siblings, 1 reply; 8+ messages in thread
From: Christoph Müllner @ 2025-06-09 21:43 UTC (permalink / raw)
To: Simon Marchi; +Cc: mailing-list, gdb-patches, Chris Packham, Tom Tromey
On Mon, Jun 9, 2025 at 9:46 PM Simon Marchi <simark@simark.ca> wrote:
>
> On 6/9/25 1:17 PM, Christoph Müllner wrote:
> > This patch from Apr 30, 2025 landed as 5c87b330e91 on master.
> > Would it be possible to apply it to gdb-16-branch as well?
> > The patch applies cleanly.
> >
> > Thanks,
> > Christoph
>
> There (probably) won't be any more GDB 16 releases, but I think it can
> be useful for some people to backport the patch anyway. We need to have
> a Bugzilla PR number first (if there isn't one already).
The patch on master does not have a PR, and I could not find anything
related to this issue in Bugzilla. Therefore, I've created a PR for
the backport:
https://sourceware.org/bugzilla/show_bug.cgi?id=33071
For me, a backport to gdb-16-branch is enough.
Thanks,
Christoph
>
> Simon
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] readline/tcap.h: Update definitions for C23
2025-06-09 21:43 ` Christoph Müllner
@ 2025-06-10 13:04 ` Tom Tromey
0 siblings, 0 replies; 8+ messages in thread
From: Tom Tromey @ 2025-06-10 13:04 UTC (permalink / raw)
To: Christoph Müllner
Cc: Simon Marchi, mailing-list, gdb-patches, Chris Packham, Tom Tromey
>>>>> "Christoph" == Christoph Müllner <christoph.muellner@vrull.eu> writes:
Christoph> The patch on master does not have a PR, and I could not find anything
Christoph> related to this issue in Bugzilla. Therefore, I've created a PR for
Christoph> the backport:
Christoph> https://sourceware.org/bugzilla/show_bug.cgi?id=33071
Christoph> For me, a backport to gdb-16-branch is enough.
Thanks. I'm going to check this in on the gdb-16 branch momentarily.
Tom
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-06-10 13:04 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-30 4:49 [PATCH] readline/tcap.h: Update definitions for C23 Chris Packham
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox