public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [libgfortran,patch] Remove never-used debugging code
@ 2015-08-24 18:49 FX
  2015-08-25 16:25 ` FX
  0 siblings, 1 reply; 6+ messages in thread
From: FX @ 2015-08-24 18:49 UTC (permalink / raw)
  To: gcc-patches; +Cc: gfortran

[-- Attachment #1: Type: text/plain, Size: 400 bytes --]

Continuing the summer clean-ups.

There is in the init() function some dead debugging code, which as far as I know is never used: it’s compiled conditionaly on DEBUG being defined, and but we don’t have anything that can define DEBUG. The commented-out “resume” functionality was never implemented in gfortran. And show_variables() isn’t very useful.

OK to commit to trunk?

FX



[-- Attachment #2: unusedcode.ChangeLog --]
[-- Type: application/octet-stream, Size: 216 bytes --]

2015-08-24  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	* libgfortran.h (show_variables): Remove prototype.
	* runtime/environ.c (show_variables): Remove function.
	* runtime/main.c (init): Remove dead code.


[-- Attachment #3: unusedcode.diff --]
[-- Type: application/octet-stream, Size: 2551 bytes --]

Index: libgfortran/libgfortran.h
===================================================================
--- libgfortran/libgfortran.h	(revision 227127)
+++ libgfortran/libgfortran.h	(working copy)
@@ -796,9 +796,6 @@ internal_proto(check_buffered);
 extern void init_variables (void);
 internal_proto(init_variables);
 
-extern void show_variables (void);
-internal_proto(show_variables);
-
 unit_convert get_unformatted_convert (int);
 internal_proto(get_unformatted_convert);
 
Index: libgfortran/runtime/environ.c
===================================================================
--- libgfortran/runtime/environ.c	(revision 227127)
+++ libgfortran/runtime/environ.c	(working copy)
@@ -355,53 +355,6 @@ init_variables (void)
 }
 
 
-void
-show_variables (void)
-{
-  variable *v;
-  int n;
-
-  /* TODO: print version number.  */
-  estr_write ("GNU Fortran runtime library version "
-	     "UNKNOWN" "\n\n");
-
-  estr_write ("Environment variables:\n");
-  estr_write ("----------------------\n");
-
-  for (v = variable_table; v->name; v++)
-    {
-      n = estr_write (v->name);
-      print_spaces (25 - n);
-
-      if (v->show == show_integer)
-	estr_write ("Integer ");
-      else if (v->show == show_boolean)
-	estr_write ("Boolean ");
-      else
-	estr_write ("String  ");
-
-      v->show (v);
-      estr_write (v->desc);
-      estr_write ("\n\n");
-    }
-
-  /* System error codes */
-
-  estr_write ("\nRuntime error codes:");
-  estr_write ("\n--------------------\n");
-
-  for (n = LIBERROR_FIRST + 1; n < LIBERROR_LAST; n++)
-    if (n < 0 || n > 9)
-      st_printf ("%d  %s\n", n, translate_error (n));
-    else
-      st_printf (" %d  %s\n", n, translate_error (n));
-
-  estr_write ("\nCommand line arguments:\n");
-  estr_write ("  --help               Print this list\n");
-
-  exit (0);
-}
-
 /* This is the handling of the GFORTRAN_CONVERT_UNITS environment variable.
    It is called from environ.c to parse this variable, and from
    open.c to determine if the user specified a default for an
Index: libgfortran/runtime/main.c
===================================================================
--- libgfortran/runtime/main.c	(revision 227127)
+++ libgfortran/runtime/main.c	(working copy)
@@ -120,15 +120,6 @@ init (void)
 
   init_compile_options ();
 
-#ifdef DEBUG
-  /* Check for special command lines.  */
-
-  if (argc > 1 && strcmp (argv[1], "--help") == 0)
-    show_variables ();
-
-  /* if (argc > 1 && strcmp(argv[1], "--resume") == 0) resume();  */
-#endif
-
   random_seed_i4 (NULL, NULL, NULL);
 }
 

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

end of thread, other threads:[~2015-08-26  6:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-24 18:49 [libgfortran,patch] Remove never-used debugging code FX
2015-08-25 16:25 ` FX
2015-08-25 16:58   ` Steve Kargl
2015-08-25 17:10     ` FX
2015-08-25 18:01       ` Steve Kargl
2015-08-26  7:07         ` FX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).