From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [PATCH 1/2] gdb/guile: remove unused orig_*_port_scm variables
Date: Mon, 19 Oct 2026 12:06:38 -0400 [thread overview]
Message-ID: <20261019160644.629989-1-simon.marchi@efficios.com> (raw)
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.
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
next reply other threads:[~2026-10-19 16:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 16:06 Simon Marchi [this message]
2026-10-19 16:06 ` [PATCH 2/2] gdb/guile: remove unused escape_symbol variable Simon Marchi
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=20261019160644.629989-1-simon.marchi@efficios.com \
--to=simon.marchi@efficios.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