Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] gdb/guile: remove unused orig_*_port_scm variables
@ 2026-10-19 16:06 Simon Marchi
  2026-10-19 16:06 ` [PATCH 2/2] gdb/guile: remove unused escape_symbol variable Simon Marchi
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Marchi @ 2026-10-19 16:06 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-19 16:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-19 16:06 [PATCH 1/2] gdb/guile: remove unused orig_*_port_scm variables Simon Marchi
2026-10-19 16:06 ` [PATCH 2/2] gdb/guile: remove unused escape_symbol variable Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox