From: Andrew Burgess <aburgess@redhat.com>
To: Simon Marchi <simon.marchi@efficios.com>, gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: Re: [PATCH 1/2] gdb/guile: remove unused orig_*_port_scm variables
Date: Fri, 20 Nov 2026 17:27:04 +0000 [thread overview]
Message-ID: <xhuyfbj7jxvkn.fsf@aburgess-thinkpadp1gen8.rmtgb.csb> (raw)
In-Reply-To: <20261019160644.629989-1-simon.marchi@efficios.com>
Simon Marchi <simon.marchi@efficios.com> writes:
> Building GDB with a recent clang fails with:
>
> /home/smarchi/src/binutils-gdb/gdb/guile/scm-ports.c:72:12: error: variable 'orig_input_port_scm' set but not used [-Werror,-Wunused-but-set-global]
> /home/smarchi/src/binutils-gdb/gdb/guile/scm-ports.c:73:12: error: variable 'orig_output_port_scm' set but not used [-Werror,-Wunused-but-set-global]
> /home/smarchi/src/binutils-gdb/gdb/guile/scm-ports.c:74:12: error: variable 'orig_error_port_scm' set but not used [-Werror,-Wunused-but-set-global]
>
> These variables hold the original Guile stdio ports, recorded "for
> debugging purposes", but nothing reads them. They have been like this
> since commit ed3ef33944c3 ("Add Guile as an extension language.",
> 2014-02-09). I would guess they are not used very often, I think we can
> remove them.
LGTM
Approved-By: Andrew Burgess <aburgess@redhat.com>
Thanks,
Andrew
>
> Change-Id: I45eb07e49ba606680923f37740da5ac43e6480ad
> ---
> gdb/guile/scm-ports.c | 12 ------------
> 1 file changed, 12 deletions(-)
>
> diff --git a/gdb/guile/scm-ports.c b/gdb/guile/scm-ports.c
> index e8ded385f16e..05b8fec30390 100644
> --- a/gdb/guile/scm-ports.c
> +++ b/gdb/guile/scm-ports.c
> @@ -67,12 +67,6 @@ struct ioscm_memory_port
> ULONGEST current;
> };
>
> -/* Copies of the original system input/output/error ports.
> - These are recorded for debugging purposes. */
> -static SCM orig_input_port_scm;
> -static SCM orig_output_port_scm;
> -static SCM orig_error_port_scm;
> -
> /* This is the stdio port descriptor, scm_ptob_descriptor. */
> static scm_t_port_type *stdio_port_desc;
>
> @@ -797,12 +791,6 @@ This procedure is experimental." },
> void
> gdbscm_initialize_ports (void)
> {
> - /* Save the original stdio ports for debugging purposes. */
> -
> - orig_input_port_scm = scm_current_input_port ();
> - orig_output_port_scm = scm_current_output_port ();
> - orig_error_port_scm = scm_current_error_port ();
> -
> /* Set up the stdio ports. */
>
> ioscm_init_gdb_stdio_port ();
>
> base-commit: ec9be4b35cf367e6ffa0d5881fb20e60c68e2f89
> --
> 2.56.0
prev parent reply other threads:[~2026-11-20 17:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 16:06 Simon Marchi
2026-10-19 16:06 ` [PATCH 2/2] gdb/guile: remove unused escape_symbol variable Simon Marchi
2026-11-20 17:26 ` Andrew Burgess
2026-11-21 2:43 ` Simon Marchi
2026-11-20 17:27 ` Andrew Burgess [this message]
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=xhuyfbj7jxvkn.fsf@aburgess-thinkpadp1gen8.rmtgb.csb \
--to=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@efficios.com \
/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