]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libfortran/17748 (libgfortran contains undefined references to _environ)
authorPeter O'Gorman <peter@pogma.com>
Sat, 26 Feb 2005 18:33:11 +0000 (18:33 +0000)
committerToon Moene <toon@gcc.gnu.org>
Sat, 26 Feb 2005 18:33:11 +0000 (18:33 +0000)
2005-02-26  Peter O'Gorman  <peter@pogman.com>
            Toon Moene  <toon@moene.indiv.nluug.nl>

PR libgfortran/17748
* runtime/environ.c: Remove references to environ.
(show_variables): remove GFORTRAN_UNBUFFERED_* and
GFORTRAN_NAME_* because they require environ.
(pattern_scan): Remove function.

Co-Authored-By: Toon Moene <toon@moene.indiv.nluug.nl>
From-SVN: r95593

libgfortran/ChangeLog
libgfortran/runtime/environ.c

index cdb0868cdb6d440a664732be4c64614be3fb5ffa..03793e852acb2e147880607ec2e832ffa56e451d 100644 (file)
@@ -1,3 +1,12 @@
+2005-02-25  Peter O'Gorman  <peter@pogman.com>
+            Toon Moene  <toon@moene.indiv.nluug.nl>
+
+       PR libgfortran/17748
+       * runtime/environ.c: Remove references to environ.
+       (show_variables): remove GFORTRAN_UNBUFFERED_* and 
+       GFORTRAN_NAME_* because they require environ.
+       (pattern_scan): Remove function.
+
 2004-02-22  Paul Thomas <paulthomas2@wannado.fr>
            Bud Davis  <bdavis@gfortran.org>
 
index ae82f562b7548841454eaa81444f32aa1634a854..9fb6ed41939052792106dd4abaaf9bc255977662 100644 (file)
@@ -48,7 +48,6 @@ Boston, MA 02111-1307, USA.  */
 
 options_t options = { };
 
-extern char **environ;
 
 typedef struct variable
 {
@@ -464,12 +463,6 @@ static variable variable_table[] = {
   {"GFORTRAN_SHOW_LOCUS", 1, &options.locus, init_boolean, show_boolean,
    "If TRUE, print filename and line number where runtime errors happen."},
 
-/* GFORTRAN_NAME_xx (where xx is a unit number) gives the names of files
- * preconnected to those units. */
-
-/* GFORTRAN_UNBUFFERED_xx (where xx is a unit number) gives a boolean that is used
- * to turn off buffering for that unit. */
-
   {"GFORTRAN_OPTIONAL_PLUS", 0, &options.optional_plus, init_boolean, show_boolean,
    "Print optional plus signs in numbers where permitted.  Default FALSE."},
 
@@ -577,43 +570,9 @@ check_buffered (int n)
 }
 
 
-/* pattern_scan()-- Given an environment string, check that the name
- * has the same name as the pattern followed by an integer.  On a
- * match, a pointer to the value is returned and the integer pointed
- * to by n is updated.  Returns NULL on no match. */
-
-static char *
-pattern_scan (char *env, const char *pattern, int *n)
-{
-  char *p;
-  size_t len;
-
-  len = strlen (pattern);
-  if (strncasecmp (env, pattern, len) != 0)
-    return NULL;
-  p = env + len;
-
-  if (!isdigit (*p))
-    return NULL;
-
-  while (isdigit (*p))
-    p++;
-
-  if (*p != '=')
-    return NULL;
-
-  *p = '\0';
-  *n = atoi (env + len);
-  *p++ = '=';
-
-  return p;
-}
-
-
 void
 show_variables (void)
 {
-  char *p, **e;
   variable *v;
   int n;
 
@@ -640,26 +599,6 @@ show_variables (void)
       st_printf ("%s\n\n", v->desc);
     }
 
-  st_printf ("\nDefault unit names (GFORTRAN_NAME_x):\n");
-
-  for (e = environ; *e; e++)
-    {
-      p = pattern_scan (*e, "GFORTRAN_NAME_", &n);
-      if (p == NULL)
-       continue;
-      st_printf ("GFORTRAN_NAME_%d         %s\n", n, p);
-    }
-
-  st_printf ("\nUnit buffering overrides (GFORTRAN_UNBUFFERED_x):\n");
-  for (e = environ; *e; e++)
-    {
-      p = pattern_scan (*e, "GFORTRAN_UNBUFFERED_", &n);
-      if (p == NULL)
-       continue;
-
-      st_printf ("GFORTRAN_UNBUFFERED_%d = %s\n", n, p);
-    }
-
   /* System error codes */
 
   st_printf ("\nRuntime error codes:");