egcs-CVS19980627, some more warning fixes, part [1/1]

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Sun Jun 28 06:12:00 GMT 1998


	Here are some more warning fixes.  Okay to install?



Sat Jun 27 11:38:48 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

        * Makefile.in (fix-header): Don't needlessly depend on cpperror.o.

	* alias.c (CHECK_ALIAS_SETS_FOR_CONSISTENCY): Cast expansion to
	void since it is evaluated in a comma list.

	* mips.h (ASM_GENERATE_INTERNAL_LABEL): Always sprintf `NUM'
 	argument as a long and cast `NUM' to long to ensure it is of the
 	proper width.  Wrap macro arguments in parens when they appear in
 	the expansion.

	* sol2.h (ASM_GENERATE_INTERNAL_LABEL): Likewise.

	* sparc.h (ASM_GENERATE_INTERNAL_LABEL): Likewise.
	(ASM_DECLARE_RESULT): Fix fprintf format specifier to match
	function argument return type.
	(REGNO_OK_FOR_INDEX_P, REGNO_OK_FOR_BASE_P, REGNO_OK_FOR_FP_P,
	REGNO_OK_FOR_CCFP_P): Use `(unsigned)' not `U'.

	* cpplib.c (cpp_message_from_errno): Remove unneeded argument to
	cpp_message.

        * dbxout.c: Fix the comments after an #endif to reflect the actual
	condition tested in the preceding #if.

	* expr.c (expand_builtin): Remove unused variable `type' twice.

        * gbl-ctors.h (DO_GLOBAL_CTORS_BODY): Cast -1 before comparing it
 	to an unsigned long.

	* haifa-sched.c (print_insn_chain): Make function definition
	static to match the prototype.  Hide prototype and definition.

        * objc/objc-act.c (build_msg_pool_reference): Hide prototype and
	definition.

        * toplev.c: When testing whether to include dbxout.h, also include
	it when XCOFF_DEBUGGING_INFO is defined.

        * unroll.c (unroll_loop): Add parentheses around assignment used
	as truth value.
	
	
diff -rup orig/egcs-CVS19980627/gcc/Makefile.in egcs-CVS19980627/gcc/Makefile.in
--- orig/egcs-CVS19980627/gcc/Makefile.in	Sat Jun 27 12:02:24 1998
+++ egcs-CVS19980627/gcc/Makefile.in	Sat Jun 27 12:01:23 1998
@@ -2047,7 +2047,7 @@ xsys-protos.h: $(GCC_PASSES) $(srcdir)/s
 	rm -rf fixtmp.c
 
 fix-header: fix-header.o scan-decls.o scan.o xsys-protos.h $(HOST_LIBDEPS) \
-   cpplib.o cpphash.o cppalloc.o cppexp.o cpperror.o prefix.o version.o
+   cpplib.o cpphash.o cppalloc.o cppexp.o prefix.o version.o
 	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ fix-header.o \
 	   scan-decls.o scan.o cpplib.o cpphash.o cppalloc.o prefix.o \
 	   version.o cppexp.o $(HOST_LIBS)
diff -rup orig/egcs-CVS19980627/gcc/alias.c egcs-CVS19980627/gcc/alias.c
--- orig/egcs-CVS19980627/gcc/alias.c	Sat Jun 27 08:01:11 1998
+++ egcs-CVS19980627/gcc/alias.c	Sat Jun 27 11:08:50 1998
@@ -54,7 +54,7 @@ static rtx find_base_value		PROTO((rtx))
    && (MEM_ALIAS_SET (MEM1) || MEM_ALIAS_SET (MEM2))	\
    ? (abort (), 0) : 0)
 #else 
-#define CHECK_ALIAS_SETS_FOR_CONSISTENCY(MEM1, MEM2) 0
+#define CHECK_ALIAS_SETS_FOR_CONSISTENCY(MEM1, MEM2) ((void)0)
 #endif
 
 /* Returns nonzero if MEM1 and MEM2 do not alias because they are in
diff -rup orig/egcs-CVS19980627/gcc/config/mips/mips.h egcs-CVS19980627/gcc/config/mips/mips.h
--- orig/egcs-CVS19980627/gcc/config/mips/mips.h	Sat Jun 27 08:00:09 1998
+++ egcs-CVS19980627/gcc/config/mips/mips.h	Sat Jun 27 11:08:43 1998
@@ -4110,7 +4110,7 @@ while (0)
    This is suitable for output with `assemble_name'.  */
 
 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)			\
-  sprintf (LABEL, "*%s%s%d", LOCAL_LABEL_PREFIX, PREFIX, NUM)
+  sprintf ((LABEL), "*%s%s%ld", (LOCAL_LABEL_PREFIX), (PREFIX), (long)(NUM))
 
 /* This is how to output an assembler line defining a `double' constant.  */
 
diff -rup orig/egcs-CVS19980627/gcc/config/sparc/sol2.h egcs-CVS19980627/gcc/config/sparc/sol2.h
--- orig/egcs-CVS19980627/gcc/config/sparc/sol2.h	Sat Jun 27 08:00:32 1998
+++ egcs-CVS19980627/gcc/config/sparc/sol2.h	Sat Jun 27 11:08:48 1998
@@ -107,7 +107,7 @@ Boston, MA 02111-1307, USA.  */
 
 #undef  ASM_GENERATE_INTERNAL_LABEL
 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)	\
-  sprintf (LABEL, "*.L%s%d", PREFIX, NUM)
+  sprintf ((LABEL), "*.L%s%ld", (PREFIX), (long)(NUM))
 
 
 /* We don't use the standard svr4 STARTFILE_SPEC because it's wrong for us.
diff -rup orig/egcs-CVS19980627/gcc/config/sparc/sparc.h egcs-CVS19980627/gcc/config/sparc/sparc.h
--- orig/egcs-CVS19980627/gcc/config/sparc/sparc.h	Sat Jun 27 08:00:33 1998
+++ egcs-CVS19980627/gcc/config/sparc/sparc.h	Sat Jun 27 11:08:48 1998
@@ -1683,7 +1683,7 @@ extern int gen_v9_scc ();
    the assembler).  */
 
 #define ASM_DECLARE_RESULT(FILE, RESULT) \
-  fprintf ((FILE), "\t.proc\t0%o\n", sparc_type_code (TREE_TYPE (RESULT)))
+  fprintf ((FILE), "\t.proc\t0%lo\n", sparc_type_code (TREE_TYPE (RESULT)))
 
 /* Output the label for a function definition.  */
 
@@ -2245,16 +2245,16 @@ extern struct rtx_def *sparc_builtin_sav
    has been allocated, which happens in local-alloc.c.  */
 
 #define REGNO_OK_FOR_INDEX_P(REGNO) \
-((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < 32U)
+((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < (unsigned)32)
 #define REGNO_OK_FOR_BASE_P(REGNO) \
-((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < 32U)
+((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < (unsigned)32)
 #define REGNO_OK_FOR_FP_P(REGNO) \
-  (((unsigned) (REGNO) - 32 < (TARGET_V9 ? 64U : 32U)) \
-   || ((unsigned) reg_renumber[REGNO] - 32 < (TARGET_V9 ? 64U : 32U)))
+  (((unsigned) (REGNO) - 32 < (TARGET_V9 ? (unsigned)64 : (unsigned)32)) \
+   || ((unsigned) reg_renumber[REGNO] - 32 < (TARGET_V9 ? (unsigned)64 : (unsigned)32)))
 #define REGNO_OK_FOR_CCFP_P(REGNO) \
  (TARGET_V9 \
-  && (((unsigned) (REGNO) - 96 < 4U) \
-      || ((unsigned) reg_renumber[REGNO] - 96 < 4U)))
+  && (((unsigned) (REGNO) - 96 < (unsigned)4) \
+      || ((unsigned) reg_renumber[REGNO] - 96 < (unsigned)4)))
 
 /* Now macros that check whether X is a register and also,
    strictly, whether it is in a specified class.
@@ -2888,7 +2888,7 @@ extern struct rtx_def *legitimize_pic_ad
    This is suitable for output with `assemble_name'.  */
 
 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)	\
-  sprintf (LABEL, "*%s%d", PREFIX, NUM)
+  sprintf ((LABEL), "*%s%ld", (PREFIX), (long)(NUM))
 
 /* This is how to output an assembler line defining a `float' constant.
    We always have to use a .long pseudo-op to do this because the native
diff -rup orig/egcs-CVS19980627/gcc/cpplib.c egcs-CVS19980627/gcc/cpplib.c
--- orig/egcs-CVS19980627/gcc/cpplib.c	Sat Jun 27 08:01:27 1998
+++ egcs-CVS19980627/gcc/cpplib.c	Sat Jun 27 11:08:50 1998
@@ -7666,7 +7666,7 @@ cpp_message_from_errno (pfile, is_error,
   if (ip != NULL)
     cpp_file_line_for_message (pfile, ip->nominal_fname, ip->lineno, -1);
 
-  cpp_message (pfile, is_error, "%s: %s", name, my_strerror (e), "");
+  cpp_message (pfile, is_error, "%s: %s", name, my_strerror (e));
 }
 
 void
diff -rup orig/egcs-CVS19980627/gcc/dbxout.c egcs-CVS19980627/gcc/dbxout.c
--- orig/egcs-CVS19980627/gcc/dbxout.c	Sat Jun 27 08:01:29 1998
+++ egcs-CVS19980627/gcc/dbxout.c	Sat Jun 27 11:08:50 1998
@@ -2710,4 +2710,4 @@ dbxout_function (decl)
     dbxout_function_end ();
 #endif
 }
-#endif /* DBX_DEBUGGING_INFO */
+#endif /* DBX_DEBUGGING_INFO || XCOFF_DEBUGGING_INFO */
diff -rup orig/egcs-CVS19980627/gcc/expr.c egcs-CVS19980627/gcc/expr.c
--- orig/egcs-CVS19980627/gcc/expr.c	Sat Jun 27 08:01:36 1998
+++ egcs-CVS19980627/gcc/expr.c	Sat Jun 27 11:08:51 1998
@@ -8769,7 +8769,6 @@ expand_builtin (exp, target, subtarget, 
 	  tree dest = TREE_VALUE (arglist);
 	  tree src = TREE_VALUE (TREE_CHAIN (arglist));
 	  tree len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist)));
-	  tree type;
 
 	  int src_align
 	    = get_pointer_alignment (src, BIGGEST_ALIGNMENT) / BITS_PER_UNIT;
@@ -8830,7 +8829,6 @@ expand_builtin (exp, target, subtarget, 
 	  tree dest = TREE_VALUE (arglist);
 	  tree val = TREE_VALUE (TREE_CHAIN (arglist));
 	  tree len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist)));
-	  tree type;
 
 	  int dest_align
 	    = get_pointer_alignment (dest, BIGGEST_ALIGNMENT) / BITS_PER_UNIT;
diff -rup orig/egcs-CVS19980627/gcc/gbl-ctors.h egcs-CVS19980627/gcc/gbl-ctors.h
--- orig/egcs-CVS19980627/gcc/gbl-ctors.h	Sat Jun 27 08:01:43 1998
+++ egcs-CVS19980627/gcc/gbl-ctors.h	Sat Jun 27 11:08:51 1998
@@ -83,7 +83,7 @@ extern void __do_global_dtors (void);
 do {									\
   unsigned long nptrs = (unsigned long) __CTOR_LIST__[0];		\
   unsigned i;								\
-  if (nptrs == -1)							\
+  if (nptrs == (unsigned long)-1)				        \
     for (nptrs = 0; __CTOR_LIST__[nptrs + 1] != 0; nptrs++);		\
   for (i = nptrs; i >= 1; i--)						\
     __CTOR_LIST__[i] ();						\
diff -rup orig/egcs-CVS19980627/gcc/haifa-sched.c egcs-CVS19980627/gcc/haifa-sched.c
--- orig/egcs-CVS19980627/gcc/haifa-sched.c	Sat Jun 27 08:02:19 1998
+++ egcs-CVS19980627/gcc/haifa-sched.c	Sat Jun 27 11:08:52 1998
@@ -456,7 +456,9 @@ static char *safe_concat PROTO ((char *,
 static int insn_issue_delay PROTO ((rtx));
 static int birthing_insn_p PROTO ((rtx));
 static void adjust_priority PROTO ((rtx));
+#if 0
 static void print_insn_chain PROTO ((rtx));
+#endif
 
 /* Mapping of insns to their original block prior to scheduling.  */
 static int *insn_orig_block;
@@ -6277,7 +6279,8 @@ print_insn (buf, x, verbose)
     }
 }				/* print_insn */
 
-void
+#if 0
+static void
 print_insn_chain (rtx_first)
      rtx rtx_first;
 {
@@ -6306,6 +6309,7 @@ print_insn_chain (rtx_first)
 	printf ("%s\n", str);
       }
 }				/* print_insn_chain */
+#endif
 
 /* Print visualization debugging info */
 
diff -rup orig/egcs-CVS19980627/gcc/objc/objc-act.c egcs-CVS19980627/gcc/objc/objc-act.c
--- orig/egcs-CVS19980627/gcc/objc/objc-act.c	Sat Jun 27 08:02:50 1998
+++ egcs-CVS19980627/gcc/objc/objc-act.c	Sat Jun 27 11:08:50 1998
@@ -297,7 +297,9 @@ static tree init_objc_symtab			PROTO((tr
 static void forward_declare_categories		PROTO((void));
 static void generate_objc_symtab_decl		PROTO((void));
 static tree build_selector			PROTO((tree));
+#if 0
 static tree build_msg_pool_reference		PROTO((int));
+#endif
 static tree build_typed_selector_reference     	PROTO((tree, tree));
 static tree build_selector_reference		PROTO((tree));
 static tree build_class_reference_decl		PROTO((tree));
@@ -2042,6 +2044,7 @@ build_selector (ident)
    grok.m: warning: initialization of non-const * pointer from const *
    grok.m: warning: initialization between incompatible pointer types.  */
 
+#if 0
 static tree
 build_msg_pool_reference (offset)
      int offset;
@@ -2059,7 +2062,6 @@ build_msg_pool_reference (offset)
   return expr;
 }
 
-#if 0
 static tree
 init_selector (offset)
      int offset;
diff -rup orig/egcs-CVS19980627/gcc/toplev.c egcs-CVS19980627/gcc/toplev.c
--- orig/egcs-CVS19980627/gcc/toplev.c	Sat Jun 27 08:02:40 1998
+++ egcs-CVS19980627/gcc/toplev.c	Sat Jun 27 11:08:50 1998
@@ -65,7 +65,7 @@ Boston, MA 02111-1307, USA.  */
 #include "dwarf2out.h"
 #endif
 
-#ifdef DBX_DEBUGGING_INFO
+#if defined(DBX_DEBUGGING_INFO) || defined(XCOFF_DEBUGGING_INFO)
 #include "dbxout.h"
 #endif
 
diff -rup orig/egcs-CVS19980627/gcc/unroll.c egcs-CVS19980627/gcc/unroll.c
--- orig/egcs-CVS19980627/gcc/unroll.c	Sat Jun 27 08:02:41 1998
+++ egcs-CVS19980627/gcc/unroll.c	Sat Jun 27 11:08:50 1998
@@ -718,7 +718,7 @@ unroll_loop (loop_end, insn_count, loop_
 		}
 	    }
 	}
-      else if (note = find_reg_note (insn, REG_LABEL, NULL_RTX))
+      else if ((note = find_reg_note (insn, REG_LABEL, NULL_RTX)))
 	set_label_in_map (map, CODE_LABEL_NUMBER (XEXP (note, 0)),
 			  XEXP (note, 0));
     }



	This is in the cp/ directory.

Sat Jun 27 11:38:48 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* except.c (build_eh_type_type_ref): Remove unused variable `susp'.
	(process_start_catch_block): Likewise for variables
	`false_label_rtx', `call_rtx' and `return_value_rtx'.

diff -rup orig/egcs-CVS19980627/gcc/cp/except.c egcs-CVS19980627/gcc/cp/except.c
--- orig/egcs-CVS19980627/gcc/cp/except.c	Sat Jun 27 08:00:56 1998
+++ egcs-CVS19980627/gcc/cp/except.c	Sat Jun 27 11:08:50 1998
@@ -424,7 +424,6 @@ build_eh_type_type_ref (type)
 {
   char *typestring;
   tree exp;
-  int susp;
 
   if (type == error_mark_node)
     return error_mark_node;
@@ -728,7 +727,6 @@ static void 
 process_start_catch_block (declspecs, declarator)
      tree declspecs, declarator;
 {
-  rtx false_label_rtx;
   tree decl = NULL_TREE;
   tree init;
 
@@ -758,7 +756,6 @@ process_start_catch_block (declspecs, de
   if (decl)
     {
       tree exp;
-      rtx call_rtx, return_value_rtx;
       tree init_type;
 
       /* Make sure we mark the catch param as used, otherwise we'll get




	This is in the f/ directory.

Sat Jun 27 11:38:48 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* fini.c (MAXNAMELEN): #undef before unconditionally defining it.

diff -rup orig/egcs-CVS19980627/gcc/f/fini.c egcs-CVS19980627/gcc/f/fini.c
--- orig/egcs-CVS19980627/gcc/f/fini.c	Sat Jun 27 08:01:55 1998
+++ egcs-CVS19980627/gcc/f/fini.c	Sat Jun 27 11:08:51 1998
@@ -23,6 +23,7 @@ the Free Software Foundation, 59 Temple 
 #include "proj.h"
 #include "malloc.h"
 
+#undef MAXNAMELEN
 #define MAXNAMELEN 100
 
 typedef struct _name_ *name;



More information about the Gcc-patches mailing list