egcs-CVS19980905, cp directory (c++) warning fixes

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Sun Sep 6 06:27:00 GMT 1998


	Below is a large warning cleanup in the cp directory.  Having
installed this, there are only about 135 warnings left in the c++
files, 100 of which comes from hash.h which is a generated file.  Most
of those warnings (~95) are "missing initializer for structure-member-foo"
types.  So we're really close to finishing the cp directory.

	I'd like to consider adding -W -Wall permanently to the
ALL_CFLAGS in cp/Makefile.in, as is currently done in f/Makefile.in.
This'll help keep the directory clean, especially for those who lower
warning flags in the top level directory to keep out noise.  (You know
who you are. :-) )

	Is it okay to do the above and install the patch below?

		Thanks,
		--Kaveh


Sat Sep  5 22:30:44 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* cp-tree.h (define_case_label): Remove unused parameter.
	(check_java_method): Likewise.
	(grokclassfn): Likewise.
	(expand_aggr_init): Likewise.
	(build_x_delete): Likewise.
	(maybe_end_member_template_processing): Likewise.
	(unshare_base_binfos): Add prototype.
	(string_conv_p): Likewise.
	(my_friendly_abort): Mark with ATTRIBUTE_NORETURN.

	* cvt.c (build_up_reference): Remove unused parameter
 	`checkconst', all callers changed.
	(build_type_conversion): Mark parameter `code' with
	ATTRIBUTE_UNUSED.
	(build_expr_type_conversion): Initialize variable `conv'.

	* decl.c (push_namespace): Initialize variable `d'.
  	(define_case_label): Remove unused parameter `decl', all callers
 	changed.

	* decl2.c (lang_decode_option): If !USE_CPPLIB, mark parameter
 	`argc' with ATTRIBUTE_UNUSED.
	(grokclassfn): Remove unused parameter `cname', all callers
 	changed.
	(check_java_method): Likewise for parameter `ctype'.
	(copy_assignment_arg_p): Mark parameter `virtualp' with
	ATTRIBUTE_UNUSED.
	(finish_prevtable_vardecl): Likewise for parameter `prev'.

	* expr.c (extract_init): Likewise for parameters `decl' and `init'.

	* init.c (expand_aggr_init_1): Remove unused parameter
 	`alias_this', all callers changed.
	(expand_aggr_init): Likewise.
	(expand_default_init): Likewise.
	(build_new_1): Initialize variable `susp'.
	(build_x_delete): Remove unused parameter `type', all callers
	changed.

	* lex.c (set_typedecl_interface_info): Mark parameter `prev' with
	ATTRIBUTE_UNUSED.
	(readescape): Use (unsigned) value in shift.
	(real_yylex): Likewise.  Likewise.  Also cast `sizeof' to int when
	comparing to a signed quantity.

	* pt.c (maybe_end_member_template_processing): Remove unused
 	parameter `decl', all callers changed.
	(check_explicit_specialization): Add braces around empty body in
	an else-statement.
	(current_template_args): Initialize variable `args'.
	(lookup_template_class): Likewise for variable `prev_local_enum'.
	(tsubst_decl): Likewise for variable `r'.
	(tsubst_arg_types): Remove unused variable `result'.
	(set_mangled_name_for_template_decl): Initialize variable
	`context'.

	* spew.c (scan_tokens): Change type of parameter `n' to unsigned.
	Likewise for variable `i'.
	(yylex): Initialize variable `trrr'.

	* typeck.c (compparms): Mark variable `strict' with
	ATTRIBUTE_UNUSED.

	* xref.c (simplify_type): Cast argument of ctype function to
	`unsigned char'.
	
diff -rup orig/egcs-CVS19980905/gcc/cp/cp-tree.h egcs-CVS19980905/gcc/cp/cp-tree.h
--- orig/egcs-CVS19980905/gcc/cp/cp-tree.h	Sat Sep  5 08:04:08 1998
+++ egcs-CVS19980905/gcc/cp/cp-tree.h	Sat Sep  5 19:44:46 1998
@@ -2499,7 +2499,7 @@ extern tree shadow_label			PROTO((tree))
 extern tree define_label			PROTO((char *, int, tree));
 extern void push_switch				PROTO((void));
 extern void pop_switch				PROTO((void));
-extern void define_case_label			PROTO((tree));
+extern void define_case_label			PROTO((void));
 extern tree getdecls				PROTO((void));
 extern tree gettags				PROTO((void));
 #if 0
@@ -2570,14 +2570,14 @@ extern void revert_static_member_fn     
 extern void cat_namespace_levels                PROTO((void));
 
 /* in decl2.c */
-extern int check_java_method			PROTO((tree, tree));
+extern int check_java_method			PROTO((tree));
 extern int lang_decode_option			PROTO((int, char **));
 extern tree grok_method_quals			PROTO((tree, tree, tree));
 extern void warn_if_unknown_interface		PROTO((tree));
 extern tree grok_x_components			PROTO((tree, tree));
 extern void maybe_retrofit_in_chrg		PROTO((tree));
 extern void maybe_make_one_only			PROTO((tree));
-extern void grokclassfn				PROTO((tree, tree, tree, enum overload_flags, tree));
+extern void grokclassfn				PROTO((tree, tree, enum overload_flags, tree));
 extern tree grok_alignof			PROTO((tree));
 extern tree grok_array_decl			PROTO((tree, tree));
 extern tree delete_sanity			PROTO((tree, tree, int, int));
@@ -2690,7 +2690,7 @@ extern void expand_direct_vtbls_init		PR
 extern void emit_base_init			PROTO((tree, int));
 extern void check_base_init			PROTO((tree));
 extern void expand_member_init			PROTO((tree, tree, tree));
-extern void expand_aggr_init			PROTO((tree, tree, int, int));
+extern void expand_aggr_init			PROTO((tree, tree, int));
 extern int is_aggr_typedef			PROTO((tree, int));
 extern int is_aggr_type				PROTO((tree, int));
 extern tree get_aggr_from_typedef		PROTO((tree, int));
@@ -2702,7 +2702,7 @@ extern tree decl_constant_value			PROTO(
 extern tree build_new				PROTO((tree, tree, tree, int));
 extern tree build_new_1				PROTO((tree));
 extern tree expand_vec_init			PROTO((tree, tree, tree, tree, int));
-extern tree build_x_delete			PROTO((tree, tree, int, tree));
+extern tree build_x_delete			PROTO((tree, int, tree));
 extern tree build_delete			PROTO((tree, tree, tree, int, int));
 extern tree build_vbase_delete			PROTO((tree, tree));
 extern tree build_vec_delete			PROTO((tree, tree, tree, tree, int));
@@ -2785,7 +2785,7 @@ extern tree tsubst_expr				PROTO ((tree,
 extern tree tsubst_copy				PROTO ((tree, tree, tree));
 extern tree tsubst_chain			PROTO((tree, tree));
 extern void maybe_begin_member_template_processing PROTO((tree));
-extern void maybe_end_member_template_processing PROTO((tree));
+extern void maybe_end_member_template_processing PROTO((void));
 extern tree finish_member_template_decl         PROTO((tree, tree));
 extern void begin_template_parm_list		PROTO((void));
 extern void begin_specialization                PROTO((void));
@@ -2970,6 +2970,7 @@ extern int yylex				PROTO((void));
 extern tree arbitrate_lookup			PROTO((tree, tree, tree));
 
 /* in tree.c */
+extern void unshare_base_binfos			PROTO((tree));
 extern int member_p				PROTO((tree));
 extern int real_lvalue_p			PROTO((tree));
 extern tree build_min				PVPROTO((enum tree_code, tree, ...));
@@ -3044,6 +3045,7 @@ extern void push_expression_obstack		PRO
   hash_tree_cons (0, 0, 0, (PURPOSE), (VALUE), (CHAIN))
 
 /* in typeck.c */
+extern int string_conv_p			PROTO((tree, tree, int));
 extern tree condition_conversion		PROTO((tree));
 extern tree target_type				PROTO((tree));
 extern tree require_complete_type		PROTO((tree));
@@ -3121,7 +3123,8 @@ extern void readonly_error			PROTO((tree
 extern void abstract_virtuals_error		PROTO((tree, tree));
 extern void signature_error			PROTO((tree, tree));
 extern void incomplete_type_error		PROTO((tree, tree));
-extern void my_friendly_abort			PROTO((int));
+extern void my_friendly_abort			PROTO((int))
+  ATTRIBUTE_NORETURN;
 extern void my_friendly_assert			PROTO((int, int));
 extern tree store_init_value			PROTO((tree, tree));
 extern tree digest_init				PROTO((tree, tree, tree *));
diff -rup orig/egcs-CVS19980905/gcc/cp/cvt.c egcs-CVS19980905/gcc/cp/cvt.c
--- orig/egcs-CVS19980905/gcc/cp/cvt.c	Sat Sep  5 08:04:38 1998
+++ egcs-CVS19980905/gcc/cp/cvt.c	Sat Sep  5 21:31:23 1998
@@ -36,7 +36,7 @@ extern tree static_aggregates;
 
 static tree cp_convert_to_pointer PROTO((tree, tree));
 static tree convert_to_pointer_force PROTO((tree, tree));
-static tree build_up_reference PROTO((tree, tree, int, int));
+static tree build_up_reference PROTO((tree, tree, int));
 
 /* Change of width--truncation and extension of integers or reals--
    is represented with NOP_EXPR.  Proper functioning of many things
@@ -343,9 +343,9 @@ convert_to_pointer_force (type, expr)
    DIRECT_BIND in FLAGS controls how any temporaries are generated.  */
 
 static tree
-build_up_reference (type, arg, flags, checkconst)
+build_up_reference (type, arg, flags)
      tree type, arg;
-     int flags, checkconst;
+     int flags;
 {
   tree rval;
   tree argtype = TREE_TYPE (arg);
@@ -471,8 +471,7 @@ convert_to_reference (reftype, expr, con
 	    }
 	}
 
-      return build_up_reference (reftype, expr, flags,
-				 ! (convtype & CONV_CONST));
+      return build_up_reference (reftype, expr, flags);
     }
   else if ((convtype & CONV_REINTERPRET) && lvalue_p (expr))
     {
@@ -501,7 +500,7 @@ convert_to_reference (reftype, expr, con
 					 "converting", 0, 0);
       if (rval == error_mark_node)
 	return error_mark_node;
-      rval = build_up_reference (reftype, rval, flags, 1);
+      rval = build_up_reference (reftype, rval, flags);
 
       if (rval && ! TYPE_READONLY (TREE_TYPE (reftype)))
 	cp_pedwarn ("initializing non-const `%T' with `%T' will use a temporary",
@@ -920,7 +919,7 @@ convert_force (type, expr, convtype)
 
 tree
 build_type_conversion (code, xtype, expr, for_sure)
-     enum tree_code code;
+     enum tree_code code ATTRIBUTE_UNUSED;
      tree xtype, expr;
      int for_sure;
 {
@@ -942,7 +941,7 @@ build_expr_type_conversion (desires, exp
      int complain;
 {
   tree basetype = TREE_TYPE (expr);
-  tree conv;
+  tree conv = NULL_TREE;
   tree winner = NULL_TREE;
 
   if (expr == null_node 
diff -rup orig/egcs-CVS19980905/gcc/cp/decl.c egcs-CVS19980905/gcc/cp/decl.c
--- orig/egcs-CVS19980905/gcc/cp/decl.c	Sat Sep  5 08:04:42 1998
+++ egcs-CVS19980905/gcc/cp/decl.c	Sat Sep  5 19:44:47 1998
@@ -1769,7 +1769,7 @@ void
 push_namespace (name)
      tree name;
 {
-  tree d;
+  tree d = NULL_TREE;
   int need_new = 1;
   int implicit_use = 0;
   int global = 0;
@@ -4401,8 +4401,7 @@ pop_switch ()
 /* XXX Note decl is never actually used. (bpk) */
 
 void
-define_case_label (decl)
-     tree decl;
+define_case_label ()
 {
   tree cleanup = last_cleanup_this_contour ();
   struct binding_level *b = current_binding_level;
@@ -7524,7 +7523,7 @@ cp_finish_decl (decl, init, asmspec_tree
 		{
 		  emit_line_note (DECL_SOURCE_FILE (decl),
 				  DECL_SOURCE_LINE (decl));
-		  expand_aggr_init (decl, init, 0, flags);
+		  expand_aggr_init (decl, init, flags);
 		}
 
 	      /* Set this to 0 so we can tell whether an aggregate which
@@ -7655,7 +7654,7 @@ expand_static_init (decl, init)
       if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl))
 	  || (init && TREE_CODE (init) == TREE_LIST))
 	{
-	  expand_aggr_init (decl, init, 0, 0);
+	  expand_aggr_init (decl, init, 0);
 	  do_pending_stack_adjust ();
 	}
       else if (init)
@@ -8010,14 +8009,14 @@ grokfndecl (ctype, type, declarator, ori
 	 the following calls is supposed to do.  */
       DECL_CONSTRUCTOR_P (decl) = 1;
 
-      grokclassfn (ctype, declarator, decl, flags, quals);
+      grokclassfn (ctype, decl, flags, quals);
 
       decl = check_explicit_specialization (orig_declarator, decl,
 					    template_count, 
 					    2 * (funcdef_flag != 0) + 
 					    4 * (friendp != 0));
 
-      if ((! TYPE_FOR_JAVA (ctype) || check_java_method (ctype, decl))
+      if ((! TYPE_FOR_JAVA (ctype) || check_java_method (decl))
 	  && check)
 	{
 	  tmp = check_classfn (ctype, decl);
@@ -8057,14 +8056,14 @@ grokfndecl (ctype, type, declarator, ori
 	 This call may change the type of the function (because
 	 of default parameters)!  */
       if (ctype != NULL_TREE)
-	grokclassfn (ctype, cname, decl, flags, quals);
+	grokclassfn (ctype, decl, flags, quals);
 
       decl = check_explicit_specialization (orig_declarator, decl,
 					    template_count, 
 					    2 * (funcdef_flag != 0) + 
 					    4 * (friendp != 0));
       if (ctype != NULL_TREE
-	  && (! TYPE_FOR_JAVA (ctype) || check_java_method (ctype, decl))
+	  && (! TYPE_FOR_JAVA (ctype) || check_java_method (decl))
 	  && check)
 	{
 	  tmp = check_classfn (ctype, decl);
diff -rup orig/egcs-CVS19980905/gcc/cp/decl2.c egcs-CVS19980905/gcc/cp/decl2.c
--- orig/egcs-CVS19980905/gcc/cp/decl2.c	Sat Sep  5 08:04:45 1998
+++ egcs-CVS19980905/gcc/cp/decl2.c	Sat Sep  5 21:19:29 1998
@@ -496,7 +496,11 @@ static struct { char *string; int *varia
 
 int   
 lang_decode_option (argc, argv)
-     int argc;
+     int argc
+#if !USE_CPPLIB
+  ATTRIBUTE_UNUSED
+#endif
+  ;
      char **argv;
 
 {
@@ -1040,8 +1044,8 @@ maybe_retrofit_in_chrg (fn)
    QUALS are the qualifiers for the this pointer.  */
 
 void
-grokclassfn (ctype, cname, function, flags, quals)
-     tree ctype, cname, function;
+grokclassfn (ctype, function, flags, quals)
+     tree ctype, function;
      enum overload_flags flags;
      tree quals;
 {
@@ -1395,8 +1399,8 @@ acceptable_java_type (type)
    Otherwise, print appropriate error messages, and return 0.  */
 
 int
-check_java_method (ctype, method)
-     tree ctype, method;
+check_java_method (method)
+     tree method;
 {
   int jerr = 0;
   tree arg_types = TYPE_ARG_TYPES (TREE_TYPE (method));
@@ -1936,7 +1940,7 @@ grokoptypename (declspecs, declarator)
 int
 copy_assignment_arg_p (parmtype, virtualp)
      tree parmtype;
-     int virtualp;
+     int virtualp ATTRIBUTE_UNUSED;
 {
   if (current_class_type == NULL_TREE)
     return 0;
@@ -2655,7 +2659,7 @@ import_export_class (ctype)
     
 int
 finish_prevtable_vardecl (prev, vars)
-     tree prev, vars;
+     tree prev ATTRIBUTE_UNUSED, vars;
 {
   tree ctype = DECL_CONTEXT (vars);
   import_export_class (ctype);
@@ -3291,7 +3295,7 @@ do_ctors (start)
 
 	  if (IS_AGGR_TYPE (TREE_TYPE (decl))
 	      || TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
-	    expand_aggr_init (decl, init, 0, 0);
+	    expand_aggr_init (decl, init, 0);
 	  else if (TREE_CODE (init) == TREE_VEC)
 	    {
 	      expand_expr (expand_vec_init (decl, TREE_VEC_ELT (init, 0),
diff -rup orig/egcs-CVS19980905/gcc/cp/expr.c egcs-CVS19980905/gcc/cp/expr.c
--- orig/egcs-CVS19980905/gcc/cp/expr.c	Sat Sep  5 08:04:46 1998
+++ egcs-CVS19980905/gcc/cp/expr.c	Sat Sep  5 21:19:00 1998
@@ -148,7 +148,7 @@ cplus_expand_expr (exp, target, tmode, m
 	    init = convert_from_reference (init);
 
 	    flag_access_control = 0;
-	    expand_aggr_init (slot, init, 0, LOOKUP_ONLYCONVERTING);
+	    expand_aggr_init (slot, init, LOOKUP_ONLYCONVERTING);
 	    flag_access_control = old_ac;
 
 	    if (TYPE_NEEDS_DESTRUCTOR (type))
@@ -304,7 +304,7 @@ extract_scalar_init (decl, init)
 
 int
 extract_init (decl, init)
-     tree decl, init;
+     tree decl ATTRIBUTE_UNUSED, init ATTRIBUTE_UNUSED;
 {
   return 0;
 
@@ -405,8 +405,5 @@ do_case (start, end)
 	    cp_error ("case label `%E' within scope of cleanup or variable array", start);
 	}
     }
-  if (start)
-    define_case_label (label);
-  else
-    define_case_label (NULL_TREE);
+  define_case_label ();
 }
diff -rup orig/egcs-CVS19980905/gcc/cp/friend.c egcs-CVS19980905/gcc/cp/friend.c
--- orig/egcs-CVS19980905/gcc/cp/friend.c	Sat Sep  5 08:04:49 1998
+++ egcs-CVS19980905/gcc/cp/friend.c	Sat Sep  5 19:44:47 1998
@@ -367,7 +367,7 @@ do_friend (ctype, declarator, decl, parm
 	    DECL_CONSTRUCTOR_P (decl) = 1;
 
 	  /* This will set up DECL_ARGUMENTS for us.  */
-	  grokclassfn (ctype, cname, decl, flags, quals);
+	  grokclassfn (ctype, decl, flags, quals);
 
 	  if (is_friend_template)
 	    decl = DECL_TI_TEMPLATE (push_template_decl (decl));
diff -rup orig/egcs-CVS19980905/gcc/cp/init.c egcs-CVS19980905/gcc/cp/init.c
--- orig/egcs-CVS19980905/gcc/cp/init.c	Sat Sep  5 08:04:47 1998
+++ egcs-CVS19980905/gcc/cp/init.c	Sat Sep  5 19:44:47 1998
@@ -47,10 +47,8 @@ tree current_base_init_list, current_mem
 
 static void expand_aggr_vbase_init_1 PROTO((tree, tree, tree, tree));
 static void expand_aggr_vbase_init PROTO((tree, tree, tree, tree));
-static void expand_aggr_init_1 PROTO((tree, tree, tree, tree, int,
-				      int));
-static void expand_default_init PROTO((tree, tree, tree, tree, int,
-				       int));
+static void expand_aggr_init_1 PROTO((tree, tree, tree, tree, int));
+static void expand_default_init PROTO((tree, tree, tree, tree, int));
 static tree build_vec_delete_1 PROTO((tree, tree, tree, tree, tree,
 				      int));
 static void perform_member_init PROTO((tree, tree, tree, int));
@@ -177,7 +175,7 @@ perform_member_init (member, name, init,
 			   array_type_nelts (type), TREE_VALUE (init), 1);
 	}
       else
-	expand_aggr_init (decl, init, 0, 0);
+	expand_aggr_init (decl, init, 0);
     }
   else
     {
@@ -589,7 +587,7 @@ emit_base_init (t, immediately)
 	  member = convert_pointer_to_real (base_binfo, current_class_ptr);
 	  expand_aggr_init_1 (base_binfo, NULL_TREE,
 			      build_indirect_ref (member, NULL_PTR), init,
-			      BINFO_OFFSET_ZEROP (base_binfo), LOOKUP_NORMAL);
+			      LOOKUP_NORMAL);
 
 	  expand_end_target_temps ();
 	  free_temp_slots ();
@@ -784,7 +782,7 @@ expand_aggr_vbase_init_1 (binfo, exp, ad
   if (init)
     init = TREE_VALUE (init);
   /* Call constructors, but don't set up vtables.  */
-  expand_aggr_init_1 (binfo, exp, ref, init, 0, LOOKUP_COMPLAIN);
+  expand_aggr_init_1 (binfo, exp, ref, init, LOOKUP_COMPLAIN);
 
   expand_end_target_temps ();
   free_temp_slots ();
@@ -1037,9 +1035,8 @@ expand_member_init (exp, name, init)
    perform the initialization, but not both, as it would be ambiguous.  */
 
 void
-expand_aggr_init (exp, init, alias_this, flags)
+expand_aggr_init (exp, init, flags)
      tree exp, init;
-     int alias_this;
      int flags;
 {
   tree type = TREE_TYPE (exp);
@@ -1108,18 +1105,17 @@ expand_aggr_init (exp, init, alias_this,
 
   TREE_TYPE (exp) = TYPE_MAIN_VARIANT (type);
   expand_aggr_init_1 (TYPE_BINFO (type), exp, exp,
-		      init, alias_this, LOOKUP_NORMAL|flags);
+		      init, LOOKUP_NORMAL|flags);
   TREE_TYPE (exp) = type;
   TREE_READONLY (exp) = was_const;
   TREE_THIS_VOLATILE (exp) = was_volatile;
 }
 
 static void
-expand_default_init (binfo, true_exp, exp, init, alias_this, flags)
+expand_default_init (binfo, true_exp, exp, init, flags)
      tree binfo;
      tree true_exp, exp;
      tree init;
-     int alias_this;
      int flags;
 {
   tree type = TREE_TYPE (exp);
@@ -1212,11 +1208,10 @@ expand_default_init (binfo, true_exp, ex
    its description.  */
 
 static void
-expand_aggr_init_1 (binfo, true_exp, exp, init, alias_this, flags)
+expand_aggr_init_1 (binfo, true_exp, exp, init, flags)
      tree binfo;
      tree true_exp, exp;
      tree init;
-     int alias_this;
      int flags;
 {
   tree type = TREE_TYPE (exp);
@@ -1247,7 +1242,7 @@ expand_aggr_init_1 (binfo, true_exp, exp
 
   /* We know that expand_default_init can handle everything we want
      at this point.  */
-  expand_default_init (binfo, true_exp, exp, init, alias_this, flags);
+  expand_default_init (binfo, true_exp, exp, init, flags);
 }
 
 /* Report an error if NAME is not the name of a user-defined,
@@ -2311,7 +2306,7 @@ build_new_1 (exp)
     }
   else
     {
-      int susp;
+      int susp = 0;
 
       if (flag_exceptions)
 	/* We will use RVAL when generating an exception handler for
@@ -2622,7 +2617,7 @@ build_vec_delete_1 (base, maxindex, type
       /* This is the real size */
       virtual_size = size_binop (PLUS_EXPR, virtual_size, BI_header_size);
       body = build_expr_list (NULL_TREE,
-			      build_x_delete (ptype, base_tbd,
+			      build_x_delete (base_tbd,
 					      2 | use_global_delete,
 					      virtual_size));
       body = build (COND_EXPR, void_type_node,
@@ -2679,7 +2674,7 @@ build_vec_delete_1 (base, maxindex, type
 	  /* True size with header.  */
 	  virtual_size = size_binop (PLUS_EXPR, virtual_size, BI_header_size);
 	}
-      deallocate_expr = build_x_delete (ptype, base_tbd,
+      deallocate_expr = build_x_delete (base_tbd,
 					2 | use_global_delete,
 					virtual_size);
       if (auto_delete_vec != integer_one_node)
@@ -2793,7 +2788,7 @@ expand_vec_init (decl, base, maxindex, i
 	  while (elts)
 	    {
 	      host_i -= 1;
-	      expand_aggr_init (baseref, TREE_VALUE (elts), 0, 0);
+	      expand_aggr_init (baseref, TREE_VALUE (elts), 0);
 
 	      expand_assignment (base, baseinc, 0, 0);
 	      elts = TREE_CHAIN (elts);
@@ -2883,7 +2878,7 @@ expand_vec_init (decl, base, maxindex, i
 	  if (from_array == 2)
 	    expand_expr_stmt (build_modify_expr (to, NOP_EXPR, from));
 	  else if (TYPE_NEEDS_CONSTRUCTING (type))
-	    expand_aggr_init (to, from, 0, 0);
+	    expand_aggr_init (to, from, 0);
 	  else if (from)
 	    expand_assignment (to, from, 0, 0);
 	  else
@@ -2897,7 +2892,7 @@ expand_vec_init (decl, base, maxindex, i
 			   array_type_nelts (type), 0, 0);
 	}
       else
-	expand_aggr_init (build1 (INDIRECT_REF, type, base), init, 0, 0);
+	expand_aggr_init (build1 (INDIRECT_REF, type, base), init, 0);
 
       expand_assignment (base,
 			 build (PLUS_EXPR, build_pointer_type (type), base, size),
@@ -2975,8 +2970,8 @@ expand_vec_init (decl, base, maxindex, i
    This does not call any destructors.  */
 
 tree
-build_x_delete (type, addr, which_delete, virtual_size)
-     tree type, addr;
+build_x_delete (addr, which_delete, virtual_size)
+     tree addr;
      int which_delete;
      tree virtual_size;
 {
diff -rup orig/egcs-CVS19980905/gcc/cp/lex.c egcs-CVS19980905/gcc/cp/lex.c
--- orig/egcs-CVS19980905/gcc/cp/lex.c	Sat Sep  5 08:04:49 1998
+++ egcs-CVS19980905/gcc/cp/lex.c	Sat Sep  5 21:46:24 1998
@@ -1179,7 +1179,7 @@ interface_strcmp (s)
 
 static void
 set_typedecl_interface_info (prev, vars)
-     tree prev, vars;
+     tree prev ATTRIBUTE_UNUSED, vars;
 {
   tree id = get_time_identifier (DECL_SOURCE_FILE (vars));
   tree fileinfo = IDENTIFIER_CLASS_VALUE (id);
@@ -1285,7 +1285,7 @@ process_next_inline (t)
   tree context;
   struct pending_inline *i = (struct pending_inline *) TREE_PURPOSE (t);
   context = hack_decl_function_context (i->fndecl);  
-  maybe_end_member_template_processing (i->fndecl);
+  maybe_end_member_template_processing ();
   if (context)
     pop_cp_function_context (context);
   i = i->next;
@@ -1936,7 +1936,7 @@ do_pending_defargs ()
 
       if (TREE_CODE (defarg_fn) == FUNCTION_DECL)
 	{
-	  maybe_end_member_template_processing (defarg_fn);
+	  maybe_end_member_template_processing ();
 	  check_default_args (defarg_fn);
 	}
 
@@ -2704,7 +2704,8 @@ readescape (ignore_ptr)
 	;
       else if ((count - 1) * 4 >= TYPE_PRECISION (integer_type_node)
 	       || (count > 1
-		   && ((1 << (TYPE_PRECISION (integer_type_node) - (count - 1) * 4))
+		   && (((unsigned)1 <<
+			(TYPE_PRECISION (integer_type_node) - (count - 1) * 4))
 		       <= firstdig)))
 	pedwarn ("hex escape out of range");
       return code;
@@ -4017,7 +4018,7 @@ real_yylex ()
 		if (ignore)
 		  goto tryagain;
 		if (width < HOST_BITS_PER_INT
-		    && (unsigned) c >= (1 << width))
+		    && (unsigned) c >= ((unsigned)1 << width))
 		  pedwarn ("escape sequence out of range for character");
 #ifdef MAP_CHARACTER
 		if (ISPRINT (c))
@@ -4178,7 +4179,7 @@ real_yylex ()
 		if (ignore)
 		  goto skipnewline;
 		if (width < HOST_BITS_PER_INT
-		    && (unsigned) c >= (1 << width))
+		    && (unsigned) c >= ((unsigned)1 << width))
 		  warning ("escape sequence out of range for character");
 	      }
 	    else if (c == '\n')
@@ -4238,7 +4239,7 @@ real_yylex ()
 		for (byte = 0; byte < WCHAR_BYTES; ++byte)
 		  {
 		    int value;
-		    if (byte >= sizeof (c))
+		    if (byte >= (int) sizeof(c))
 		      value = 0;
 		    else
 		      value = (c >> (byte * width)) & bytemask;
diff -rup orig/egcs-CVS19980905/gcc/cp/pt.c egcs-CVS19980905/gcc/cp/pt.c
--- orig/egcs-CVS19980905/gcc/cp/pt.c	Sat Sep  5 08:04:53 1998
+++ egcs-CVS19980905/gcc/cp/pt.c	Sat Sep  5 21:02:24 1998
@@ -391,8 +391,7 @@ maybe_begin_member_template_processing (
 /* Undo the effects of begin_member_template_processing. */
 
 void 
-maybe_end_member_template_processing (decl)
-     tree decl;
+maybe_end_member_template_processing ()
 {
   if (! processing_template_decl)
     return;
@@ -1221,19 +1220,21 @@ check_explicit_specialization (declarato
 	      DECL_TEMPLATE_INFO (decl) = ti;
 	    }
 	  else
-	    /* It's not legal to write an explicit instantiation in
-	       class scope, e.g.:
+	    {
+	      /* It's not legal to write an explicit instantiation in
+		 class scope, e.g.:
 
-	         class C { template void f(); }
+	           class C { template void f(); }
 
-	       This case is caught by the parser.  However, on
-	       something like:
+		   This case is caught by the parser.  However, on
+		   something like:
 	       
-	         template class C { void f(); };
+		   template class C { void f(); };
 
-	       (which is illegal) we can get here.  The error will be
-	       issued later.  */
-	    ;
+		   (which is illegal) we can get here.  The error will be
+		   issued later.  */
+	      ;
+	    }
 
 	  return decl;
 	}
@@ -1691,7 +1692,7 @@ tree
 current_template_args ()
 {
   tree header;
-  tree args;
+  tree args = NULL_TREE;
   int length = TMPL_PARMS_DEPTH (current_template_parms);
   int l = length;
 
@@ -3244,7 +3245,7 @@ lookup_template_class (d1, arglist, in_d
       int arg_depth;
       int parm_depth;
       int is_partial_instantiation;
-      tree prev_local_enum;
+      tree prev_local_enum = NULL_TREE;
 
       template = most_general_template (template);
       parmlist = DECL_TEMPLATE_PARMS (template);
@@ -4716,7 +4717,7 @@ tsubst_decl (t, args, type, in_decl)
 {
   int saved_lineno;
   char* saved_filename;
-  tree r;
+  tree r = NULL_TREE;
 
   /* Set the filename and linenumber to improve error-reporting.  */
   saved_lineno = lineno;
@@ -5204,7 +5205,6 @@ tsubst_arg_types (arg_types, args, in_de
      tree in_decl;
 {
   tree remaining_arg_types;
-  tree result;
   tree type;
 
   if (!arg_types || arg_types == void_list_node)
@@ -8220,7 +8220,7 @@ set_mangled_name_for_template_decl (decl
      tree decl;
 {
   tree saved_namespace;
-  tree context;
+  tree context = NULL_TREE;
   tree fn_type;
   tree ret_type;
   tree parm_types;
diff -rup orig/egcs-CVS19980905/gcc/cp/spew.c egcs-CVS19980905/gcc/cp/spew.c
--- orig/egcs-CVS19980905/gcc/cp/spew.c	Sat Sep  5 08:04:56 1998
+++ egcs-CVS19980905/gcc/cp/spew.c	Sat Sep  5 21:53:49 1998
@@ -47,7 +47,7 @@ struct token  {
 
 static int do_aggr PROTO((void));
 static int probe_obstack PROTO((struct obstack *, tree, unsigned int));
-static void scan_tokens PROTO((int));
+static void scan_tokens PROTO((unsigned int));
 
 #ifdef SPEW_DEBUG
 static int num_tokens PROTO((void));
@@ -155,9 +155,9 @@ consume_token ()
 
 static void
 scan_tokens (n)
-     int n;
+     unsigned int n;
 {
-  int i;
+  unsigned int i;
   struct token *tmp;
 
   /* We cannot read past certain tokens, so make sure we don't.  */
@@ -244,7 +244,7 @@ int
 yylex ()
 {
   struct token tmp_token;
-  tree trrr;
+  tree trrr = NULL_TREE;
   int old_looking_for_typename = 0;
 
  retry:
diff -rup orig/egcs-CVS19980905/gcc/cp/typeck.c egcs-CVS19980905/gcc/cp/typeck.c
--- orig/egcs-CVS19980905/gcc/cp/typeck.c	Sat Sep  5 08:04:57 1998
+++ egcs-CVS19980905/gcc/cp/typeck.c	Sat Sep  5 21:20:24 1998
@@ -1223,7 +1223,7 @@ common_base_type (tt1, tt2)
 int
 compparms (parms1, parms2, strict)
      tree parms1, parms2;
-     int strict;
+     int strict ATTRIBUTE_UNUSED;
 {
   register tree t1 = parms1, t2 = parms2;
 
diff -rup orig/egcs-CVS19980905/gcc/cp/xref.c egcs-CVS19980905/gcc/cp/xref.c
--- orig/egcs-CVS19980905/gcc/cp/xref.c	Sat Sep  5 08:04:58 1998
+++ egcs-CVS19980905/gcc/cp/xref.c	Sat Sep  5 19:44:48 1998
@@ -731,7 +731,7 @@ simplify_type(typ)
   int lvl, i;
 
   i = strlen(typ);
-  while (i > 0 && ISSPACE(typ[i-1])) typ[--i] = 0;
+  while (i > 0 && ISSPACE((unsigned char) typ[i-1])) typ[--i] = 0;
 
   if (i > 7 && STREQL(&typ[i-5], "const"))
     {



More information about the Gcc-patches mailing list