This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Remove unused variables in libgfortran


The appended patch removes warnings of the falling kind from
libgfortran:
../../../../libgfortran/intrinsics/unlink.c:54: warning: unused variable 's'

I'll test with a full bootstrap/testsuite run on Linux/x86-64 now.  Ok
to commit if it passes?

Andreas

2005-05-15  Andreas Jaeger  <aj@suse.de>

	* runtime/string.c (compare0): Remove unused variable.
	* io/unit.c (init_units): Remove unused variables.
	* intrinsics/getcwd.c (getcwd_i4_sub): Remove unused variable.
	* intrinsics/unlink.c (unlink_i4_sub): Remove unused variable.
	* intrinsics/stat.c (stat_i4_sub, fstat_i8_sub, fstat_i4_sub,
	stat_i8_sub): Remove unused variable.

============================================================
Index: libgfortran/runtime/string.c
--- runtime/string.c	9 Apr 2005 19:37:14 -0000	1.5
+++ runtime/string.c	14 May 2005 22:59:12 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
    Contributed by Paul Brook
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -40,12 +40,11 @@ Boston, MA 02111-1307, USA.  */
 static int
 compare0 (const char *s1, int s1_len, const char *s2)
 {
-  int i;
   int len;
 
   /* Strip trailing blanks from the Fortran string.  */
-  len = fstrlen(s1, s1_len);
-  return strncasecmp(s1,s2,len) == 0;
+  len = fstrlen (s1, s1_len);
+  return strncasecmp (s1, s2, len) == 0;
 }
 
 
============================================================
Index: libgfortran/io/unit.c
--- io/unit.c	12 May 2005 17:50:32 -0000	1.9
+++ io/unit.c	14 May 2005 22:59:12 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
    Contributed by Andy Vaught
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -288,7 +288,6 @@ is_internal_unit ()
 void
 init_units (void)
 {
-  gfc_offset m, n;
   gfc_unit *u;
   int i;
 
============================================================
Index: libgfortran/intrinsics/getcwd.c
--- intrinsics/getcwd.c	12 Jan 2005 21:27:30 -0000	1.3
+++ intrinsics/getcwd.c	14 May 2005 22:59:12 -0000
@@ -1,5 +1,5 @@
 /* Implementation of the GETCWD intrinsic.
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
    Contributed by Steven G. Kargl <kargls@comcast.net>.
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -46,7 +46,7 @@ iexport_proto(getcwd_i4_sub);
 void
 getcwd_i4_sub (char *cwd, GFC_INTEGER_4 *status, gfc_charlen_type cwd_len)
 {
-  char str[cwd_len + 1], *s;
+  char str[cwd_len + 1];
   GFC_INTEGER_4 stat;
 
   memset(cwd, ' ', (size_t) cwd_len);
============================================================
Index: libgfortran/intrinsics/unlink.c
--- intrinsics/unlink.c	12 Jan 2005 21:27:30 -0000	1.4
+++ intrinsics/unlink.c	14 May 2005 22:59:12 -0000
@@ -1,5 +1,5 @@
 /* Implementation of the UNLINK intrinsic.
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
    Contributed by Steven G. Kargl <kargls@comcast.net>.
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -51,7 +51,7 @@ iexport_proto(unlink_i4_sub);
 void
 unlink_i4_sub (char *name, GFC_INTEGER_4 *status, gfc_charlen_type name_len)
 {
-  char *str, *s;
+  char *str;
   GFC_INTEGER_4 stat;
 
   /* Trim trailing spaces from name.  */
============================================================
Index: libgfortran/intrinsics/stat.c
--- intrinsics/stat.c	4 May 2005 21:38:15 -0000	1.5
+++ intrinsics/stat.c	14 May 2005 22:59:12 -0000
@@ -1,5 +1,5 @@
 /* Implementation of the STAT and FSTAT intrinsics.
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
    Contributed by Steven G. Kargl <kargls@comcast.net>.
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -73,8 +73,6 @@ stat_i4_sub (char *name, gfc_array_i4 *s
   char *str;
   struct stat sb;
 
-  index_type stride[GFC_MAX_DIMENSIONS];
-      
   /* If the rank of the array is not 1, abort.  */
   if (GFC_DESCRIPTOR_RANK (sarray) != 1)
     runtime_error ("Array rank of SARRAY is not 1.");
@@ -168,8 +166,6 @@ stat_i8_sub (char *name, gfc_array_i8 *s
   char *str;
   struct stat sb;
 
-  index_type stride[GFC_MAX_DIMENSIONS];
-      
   /* If the rank of the array is not 1, abort.  */
   if (GFC_DESCRIPTOR_RANK (sarray) != 1)
     runtime_error ("Array rank of SARRAY is not 1.");
@@ -293,8 +289,6 @@ fstat_i4_sub (GFC_INTEGER_4 *unit, gfc_a
   int val;
   struct stat sb;
 
-  index_type stride[GFC_MAX_DIMENSIONS];
-      
   /* If the rank of the array is not 1, abort.  */
   if (GFC_DESCRIPTOR_RANK (sarray) != 1)
     runtime_error ("Array rank of SARRAY is not 1.");
@@ -379,8 +373,6 @@ fstat_i8_sub (GFC_INTEGER_8 *unit, gfc_a
   int val;
   struct stat sb;
 
-  index_type stride[GFC_MAX_DIMENSIONS];
-      
   /* If the rank of the array is not 1, abort.  */
   if (GFC_DESCRIPTOR_RANK (sarray) != 1)
     runtime_error ("Array rank of SARRAY is not 1.");

-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

Attachment: pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]