public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Robert Lipe <robertl@dgii.com>
To: egcs@cygnus.com
Subject: Warning elimination patches.
Date: Fri, 06 Feb 1998 00:57:00 -0000	[thread overview]
Message-ID: <19980206005230.23950@dgii.com> (raw)

I just wanted Kaveh to know he wasn't alone and his work was
appreciated. :-) So I knocked off a couple hundred warnings.

Yes, I know that the rules say to submit one change per patch and one
patch per email.  If that's really the rule, I'll gladly obey.  I
suspect that for relatively brainless patches like this, it would
actually be harder to grok.   

I did an update just before going through this exercise, so I think
they should drop in cleanly.

I didn't go for zero warnings in every file I touched.  I went for
the really easy ones that were self-evident.  For example, on this
pass to prove a variable really was unused, an editor search had to
not find it within scope.  So things hidden in preprocessing action
or named "i" or "n" didn't get touched this time.



Fri Feb  6 00:37:27 1998   Robert Lipe  <robertl@dgii.com>

	* c-common.c: Include <stdlib.h> and <string.h>/<strings.h>.

        * calls.c (expand_call): Remove unused variables funtree,
        n_regs, and tmpmode.

	* dbxout.c, except.c: Include <string.h>.

        * explow.c: (plus_constant_for_output_wide) Removed unused
        variable all_constant.

        * c-decl.c, genattr.c, genattrtab.c, getconfig.c, genemit.c
        genextract.c, genflags.c, genopinit.c genoutput.c, genpeep.c,
        genrecog.c, global.c, integrate.c , stupid.c : Include
        <stdlib.h>.

	* genextract.c: (walk_rtx) Remove unused variable link.

	* genrecog.c: (concat) Remove unreferenced static function.

	* prefix.c: Include <string.h>, <stdlib.h>

	* stmt.c: Include <stdlib.h>.  
	(expand_asm_operands): Remove unused variable val1.  
	(expand_return): Remove unused variable block.
	(pushcase): Remove unused variables l and n.
	(pushcaserange): Likewise.

	* unroll.c (unroll_loop): Remove unused variable temp.


? crtstuff.c.rjl
? .cvsignore
? install.texi_
? f/runtime/libU77/configure_
Index: c-common.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/c-common.c,v
retrieving revision 1.2
diff -u -p -r1.2 c-common.c
--- c-common.c	1998/02/05 20:54:49	1.2
+++ c-common.c	1998/02/06 06:19:14
@@ -27,6 +27,19 @@ Boston, MA 02111-1307, USA.  */
 #include "obstack.h"
 #include <ctype.h>
 
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+
 #ifndef WCHAR_TYPE_SIZE
 #ifdef INT_TYPE_SIZE
 #define WCHAR_TYPE_SIZE INT_TYPE_SIZE
Index: c-decl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/c-decl.c,v
retrieving revision 1.14
diff -u -p -r1.14 c-decl.c
--- c-decl.c	1998/02/01 11:47:52	1.14
+++ c-decl.c	1998/02/06 06:19:23
@@ -34,6 +34,10 @@ Boston, MA 02111-1307, USA.  */
 #include "c-tree.h"
 #include "c-lex.h"
 
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
 /* In grokdeclarator, distinguish syntactic contexts of declarators.  */
 enum decl_context
 { NORMAL,			/* Ordinary declaration */
Index: calls.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/calls.c,v
retrieving revision 1.9
diff -u -p -r1.9 calls.c
--- calls.c	1998/01/16 09:16:10	1.9
+++ calls.c	1998/02/06 06:19:27
@@ -487,8 +487,6 @@ expand_call (exp, target, ignore)
   tree actparms = TREE_OPERAND (exp, 1);
   /* RTX for the function to be called.  */
   rtx funexp;
-  /* Tree node for the function to be called (not the address!).  */
-  tree funtree;
   /* Data type of the function.  */
   tree funtype;
   /* Declaration of the function being called,
@@ -2106,9 +2104,7 @@ expand_call (exp, target, ignore)
 	 Deal with them explicitly by copying from the return registers
 	 into the target MEM locations.  */
       int bytes = int_size_in_bytes (TREE_TYPE (exp));
-      int n_regs = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
       int i;
-      enum machine_mode tmpmode;
       rtx src, dst;
       int bitsize = MIN (TYPE_ALIGN (TREE_TYPE (exp)), BITS_PER_WORD);
       int bitpos, xbitpos, big_endian_correction = 0;
Index: cplus-dem.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cplus-dem.c,v
retrieving revision 1.7
diff -u -p -r1.7 cplus-dem.c
--- cplus-dem.c	1998/01/27 22:11:32	1.7
+++ cplus-dem.c	1998/02/06 06:19:30
@@ -31,6 +31,7 @@ Boston, MA 02111-1307, USA.  */
 #include <ctype.h>
 #include <string.h>
 #include <stdio.h>
+
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
Index: dbxout.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/dbxout.c,v
retrieving revision 1.7
diff -u -p -r1.7 dbxout.c
--- dbxout.c	1998/01/28 17:07:23	1.7
+++ dbxout.c	1998/02/06 06:19:33
@@ -72,6 +72,10 @@ Boston, MA 02111-1307, USA.  */
 #include <stdio.h>
 #include <errno.h>
 
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
 #include "tree.h"
 #include "rtl.h"
 #include "flags.h"
Index: except.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/except.c,v
retrieving revision 1.32
diff -u -p -r1.32 except.c
--- except.c	1998/02/02 19:28:50	1.32
+++ except.c	1998/02/06 06:19:36
@@ -405,6 +405,10 @@ Boston, MA 02111-1307, USA.  */
 #include "recog.h"
 #include "output.h"
 
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
 /* One to use setjmp/longjmp method of generating code for exception
    handling.  */
 
Index: explow.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/explow.c,v
retrieving revision 1.3
diff -u -p -r1.3 explow.c
--- explow.c	1998/01/17 22:39:09	1.3
+++ explow.c	1998/02/06 06:19:38
@@ -153,7 +153,6 @@ plus_constant_for_output_wide (x, c)
 {
   register RTX_CODE code = GET_CODE (x);
   register enum machine_mode mode = GET_MODE (x);
-  int all_constant = 0;
 
   if (GET_CODE (x) == LO_SUM)
     return gen_rtx_LO_SUM (mode, XEXP (x, 0),
Index: genattr.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/genattr.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 genattr.c
--- genattr.c	1997/08/11 15:57:09	1.1.1.1
+++ genattr.c	1998/02/06 06:19:38
@@ -25,6 +25,10 @@ Boston, MA 02111-1307, USA.  */
 #include "rtl.h"
 #include "obstack.h"
 
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
 static struct obstack obstack;
 struct obstack *rtl_obstack = &obstack;
 
Index: genattrtab.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/genattrtab.c,v
retrieving revision 1.13
diff -u -p -r1.13 genattrtab.c
--- genattrtab.c	1998/01/30 08:04:58	1.13
+++ genattrtab.c	1998/02/06 06:19:48
@@ -121,6 +121,10 @@ Boston, MA 02111-1307, USA.  */
 # include <sys/resource.h>
 #endif
 
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
 /* We must include obstack.h after <sys/time.h>, to avoid lossage with
    /usr/include/sys/stdtypes.h on Sun OS 4.x.  */
 #include "obstack.h"
Index: genconfig.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/genconfig.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 genconfig.c
--- genconfig.c	1997/11/02 08:40:12	1.1.1.2
+++ genconfig.c	1998/02/06 06:19:48
@@ -25,6 +25,10 @@ Boston, MA 02111-1307, USA.  */
 #include "rtl.h"
 #include "obstack.h"
 
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
 static struct obstack obstack;
 struct obstack *rtl_obstack = &obstack;
 
Index: genemit.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/genemit.c,v
retrieving revision 1.4
diff -u -p -r1.4 genemit.c
--- genemit.c	1998/01/28 23:25:12	1.4
+++ genemit.c	1998/02/06 06:19:48
@@ -24,6 +24,10 @@ Boston, MA 02111-1307, USA.  */
 #include "rtl.h"
 #include "obstack.h"
 
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
 static struct obstack obstack;
 struct obstack *rtl_obstack = &obstack;
 
Index: genextract.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/genextract.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 genextract.c
--- genextract.c	1997/11/02 08:40:13	1.1.1.2
+++ genextract.c	1998/02/06 06:19:48
@@ -25,6 +25,10 @@ Boston, MA 02111-1307, USA.  */
 #include "obstack.h"
 #include "insn-config.h"
 
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
 static struct obstack obstack;
 struct obstack *rtl_obstack = &obstack;
 
@@ -196,7 +200,6 @@ walk_rtx (x, path)
   register int i;
   register int len;
   register char *fmt;
-  register struct code_ptr *link;
   int depth = strlen (path);
   char *newpath;
 
Index: genflags.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/genflags.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 genflags.c
--- genflags.c	1997/08/11 15:57:09	1.1.1.1
+++ genflags.c	1998/02/06 06:19:48
@@ -27,6 +27,10 @@ Boston, MA 02111-1307, USA.  */
 #include "rtl.h"
 #include "obstack.h"
 
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
 static struct obstack obstack;
 struct obstack *rtl_obstack = &obstack;
 
Index: genopinit.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/genopinit.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 genopinit.c
--- genopinit.c	1997/11/02 08:40:14	1.1.1.2
+++ genopinit.c	1998/02/06 06:19:48
@@ -25,6 +25,11 @@ Boston, MA 02111-1307, USA.  */
 #include "obstack.h"
 #include <ctype.h>
 
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+
 static struct obstack obstack;
 struct obstack *rtl_obstack = &obstack;
 
Index: genoutput.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/genoutput.c,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 genoutput.c
--- genoutput.c	1997/12/06 17:20:49	1.1.1.3
+++ genoutput.c	1998/02/06 06:19:48
@@ -95,6 +95,10 @@ given in the entry is a constant (it doe
 #include "rtl.h"
 #include "obstack.h"
 
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
 /* No instruction can have more operands than this.
    Sorry for this arbitrary limit, but what machine will
    have an instruction with this many operands?  */
Index: genpeep.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/genpeep.c,v
retrieving revision 1.3
diff -u -p -r1.3 genpeep.c
--- genpeep.c	1998/01/28 23:25:13	1.3
+++ genpeep.c	1998/02/06 06:19:49
@@ -24,6 +24,10 @@ Boston, MA 02111-1307, USA.  */
 #include "rtl.h"
 #include "obstack.h"
 
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
 static struct obstack obstack;
 struct obstack *rtl_obstack = &obstack;
 
Index: genrecog.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/genrecog.c,v
retrieving revision 1.2
diff -u -p -r1.2 genrecog.c
--- genrecog.c	1998/01/28 23:25:14	1.2
+++ genrecog.c	1998/02/06 06:19:51
@@ -51,6 +51,10 @@ Boston, MA 02111-1307, USA.  */
 #include "rtl.h"
 #include "obstack.h"
 
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
 static struct obstack obstack;
 struct obstack *rtl_obstack = &obstack;
 
@@ -191,7 +195,6 @@ static void change_state	PROTO((char *, 
 static char *copystr		PROTO((char *));
 static void mybzero		PROTO((char *, unsigned));
 static void mybcopy		PROTO((char *, char *, unsigned));
-static char *concat		PROTO((char *, char *));
 static void fatal		PROTO((char *));
 char *xrealloc			PROTO((char *, unsigned));
 char *xmalloc			PROTO((unsigned));
@@ -1644,25 +1647,6 @@ mybcopy (in, out, length)
 {
   while (length-- > 0)
     *out++ = *in++;
-}
-
-static char *
-concat (s1, s2)
-     char *s1, *s2;
-{
-  register char *tem;
-
-  if (s1 == 0)
-    return s2;
-  if (s2 == 0)
-    return s1;
-
-  tem = (char *) xmalloc (strlen (s1) + strlen (s2) + 2);
-  strcpy (tem, s1);
-  strcat (tem, " ");
-  strcat (tem, s2);
-
-  return tem;
 }
 
 char *
Index: global.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/global.c,v
retrieving revision 1.4
diff -u -p -r1.4 global.c
--- global.c	1997/11/02 21:17:38	1.4
+++ global.c	1998/02/06 06:19:53
@@ -21,6 +21,11 @@ Boston, MA 02111-1307, USA.  */
 
 #include "config.h"
 #include <stdio.h>
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
 #include "rtl.h"
 #include "flags.h"
 #include "basic-block.h"
Index: integrate.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/integrate.c,v
retrieving revision 1.22
diff -u -p -r1.22 integrate.c
--- integrate.c	1998/02/05 20:49:53	1.22
+++ integrate.c	1998/02/06 06:19:57
@@ -22,6 +22,11 @@ Boston, MA 02111-1307, USA.  */
 
 #include "config.h"
 #include <stdio.h>
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
 #include "rtl.h"
 #include "tree.h"
 #include "regs.h"
Index: prefix.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/prefix.c,v
retrieving revision 1.2
diff -u -p -r1.2 prefix.c
--- prefix.c	1997/11/14 03:27:55	1.2
+++ prefix.c	1998/02/06 06:19:58
@@ -71,6 +71,15 @@ Boston, MA 02111-1307, USA.  */
 #include <varargs.h>
 #endif
 
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+
 #ifdef _WIN32
 #include <windows.h>
 #endif
Index: stmt.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/stmt.c,v
retrieving revision 1.18
diff -u -p -r1.18 stmt.c
--- stmt.c	1998/02/05 20:59:44	1.18
+++ stmt.c	1998/02/06 06:20:11
@@ -38,6 +38,10 @@ Boston, MA 02111-1307, USA.  */
 #include <stdio.h>
 #include <ctype.h>
 
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
 #include "rtl.h"
 #include "tree.h"
 #include "flags.h"
@@ -1191,7 +1195,6 @@ expand_asm_operands (string, outputs, in
     {
       tree val = TREE_VALUE (tail);
       tree type = TREE_TYPE (val);
-      tree val1;
       int j;
       int found_equal = 0;
       int found_plus = 0;
@@ -2280,7 +2283,6 @@ expand_return (retval)
   register rtx op0;
   tree retval_rhs;
   int cleanups;
-  struct nesting *block;
 
   /* If function wants no value, give it none.  */
   if (TREE_CODE (TREE_TYPE (TREE_TYPE (current_function_decl))) == VOID_TYPE)
@@ -3842,8 +3844,6 @@ pushcase (value, converter, label, dupli
      register tree label;
      tree *duplicate;
 {
-  register struct case_node **l;
-  register struct case_node *n;
   tree index_type;
   tree nominal_type;
 
@@ -3925,8 +3925,6 @@ pushcase_range (value1, value2, converte
      register tree label;
      tree *duplicate;
 {
-  register struct case_node **l;
-  register struct case_node *n;
   tree index_type;
   tree nominal_type;
 
Index: stupid.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/stupid.c,v
retrieving revision 1.3
diff -u -p -r1.3 stupid.c
--- stupid.c	1998/01/14 23:10:42	1.3
+++ stupid.c	1998/02/06 06:20:12
@@ -44,6 +44,11 @@ Boston, MA 02111-1307, USA.  */
 
 #include "config.h"
 #include <stdio.h>
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
 #include "rtl.h"
 #include "hard-reg-set.h"
 #include "regs.h"
Index: unroll.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/unroll.c,v
retrieving revision 1.14
diff -u -p -r1.14 unroll.c
--- unroll.c	1998/01/14 23:10:43	1.14
+++ unroll.c	1998/02/06 06:20:21
@@ -831,7 +831,7 @@ unroll_loop (loop_end, insn_count, loop_
       if (precondition_loop_p (&initial_value, &final_value, &increment,
 			       loop_start, loop_end))
 	{
-	  register rtx diff, temp;
+	  register rtx diff ;
 	  enum machine_mode mode;
 	  rtx *labels;
 	  int abs_inc, neg_inc;

             reply	other threads:[~1998-02-06  0:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-02-06  0:57 Robert Lipe [this message]
1998-02-07 23:08 ` Jeffrey A Law
1998-02-07 12:08 Kaveh R. Ghazi
1998-02-09 19:27 Kaveh R. Ghazi
1998-02-10  0:53 ` Jeffrey A Law

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=19980206005230.23950@dgii.com \
    --to=robertl@dgii.com \
    --cc=egcs@cygnus.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).