From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kaveh R. Ghazi" To: egcs@cygnus.com Subject: egcs-19980508 warning patches part 5/5 Date: Tue, 12 May 1998 07:17:00 -0000 Message-id: <199805121416.KAA28778@caip.rutgers.edu> X-SW-Source: 1998-05/msg00402.html This is patch part 5/5. Okay to install? Note: I tried to only use ATTRIBUTE_UNUSED where the function call interface was mandated by outside constraints. These are all changes in the cp/ directory. Mon May 11 21:08:00 1998 Kaveh R. Ghazi * Makefile.in (lex.o): Depend on output.h. * call.c (add_function_candidate): Remove unused variable `cand'. (add_conv_candidate): Likewise. (build_builtin_candidate): Likewise. * cp-tree.h: Add prototype for `types_overlap_p'. * decl.c (signal_catch): Mark parameter `sig' with ATTRIBUTE_UNUSED. * decl2.c (merge_functions): Remove unused variables `tmp' and `tempn'. * error.c (expr_as_string): Mark parameter `v' with ATTRIBUTE_UNUSED. (code_as_string): Likewise. (language_as_string): Likewise. (parm_as_string): Likewise. (op_as_string): Likewise. (assop_as_string): Likewise. (cv_as_string): Likewise. * lex.c: Include output.h. * pt.c (type_unification): Cast first argument of `bzero' to a char*. * search.c (dfs_no_overlap_yet): Mark parameter `t' with ATTRIBUTE_UNUSED. * tinfo.cc (__class_type_info::dcast): Change the type of variable `i' from int to size_t. * typeck.c (language_lvalue_valid): Mark parameter `exp' with ATTRIBUTE_UNUSED. diff -rup orig/egcs-19980508/gcc/cp/Makefile.in egcs-19980508/gcc/cp/Makefile.in --- orig/egcs-19980508/gcc/cp/Makefile.in Wed May 6 12:52:21 1998 +++ egcs-19980508/gcc/cp/Makefile.in Sun May 10 20:03:15 1998 @@ -234,7 +234,8 @@ spew.o : spew.c $(CONFIG_H) $(CXX_TREE_H $(PARSE_H) $(srcdir)/../flags.h lex.h $(srcdir)/../system.h lex.o : lex.c $(CONFIG_H) $(CXX_TREE_H) \ $(PARSE_H) input.c $(srcdir)/../flags.h hash.h lex.h \ - $(srcdir)/../c-pragma.h $(srcdir)/../system.h $(srcdir)/../toplev.h + $(srcdir)/../c-pragma.h $(srcdir)/../system.h $(srcdir)/../toplev.h \ + $(srcdir)/../output.h decl.o : decl.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \ lex.h decl.h $(srcdir)/../stack.h $(srcdir)/../output.h \ $(srcdir)/../except.h $(srcdir)/../system.h $(srcdir)/../toplev.h diff -rup orig/egcs-19980508/gcc/cp/call.c egcs-19980508/gcc/cp/call.c --- orig/egcs-19980508/gcc/cp/call.c Thu May 7 22:05:43 1998 +++ egcs-19980508/gcc/cp/call.c Sun May 10 16:59:23 1998 @@ -1093,7 +1093,6 @@ add_function_candidate (candidates, fn, tree parmnode = parmlist; tree argnode = arglist; int viable = 1; - struct z_candidate *cand; /* The `this' and `in_chrg' arguments to constructors are not considered in overload resolution. */ @@ -1181,7 +1180,6 @@ add_conv_candidate (candidates, fn, obj, tree parmnode = parmlist; tree argnode = arglist; int viable = 1; - struct z_candidate *cand; int flags = LOOKUP_NORMAL; for (i = 0; i < len; ++i) @@ -1241,7 +1239,6 @@ build_builtin_candidate (candidates, fnn { tree t, convs; int viable = 1, i; - struct z_candidate *cand; tree types[2]; types[0] = type1; diff -rup orig/egcs-19980508/gcc/cp/cp-tree.h egcs-19980508/gcc/cp/cp-tree.h --- orig/egcs-19980508/gcc/cp/cp-tree.h Thu May 7 22:05:47 1998 +++ egcs-19980508/gcc/cp/cp-tree.h Sun May 10 20:17:27 1998 @@ -2542,6 +2542,7 @@ extern tree build_dynamic_cast PROTO(( extern void synthesize_tinfo_fn PROTO((tree)); /* in search.c */ +extern int types_overlap_p PROTO((tree, tree)); extern void push_memoized_context PROTO((tree, int)); extern void pop_memoized_context PROTO((int)); extern tree get_vbase PROTO((tree, tree)); diff -rup orig/egcs-19980508/gcc/cp/decl.c egcs-19980508/gcc/cp/decl.c --- orig/egcs-19980508/gcc/cp/decl.c Thu May 7 22:05:48 1998 +++ egcs-19980508/gcc/cp/decl.c Sun May 10 16:59:24 1998 @@ -5003,7 +5003,7 @@ lookup_name_current_level (name) static void signal_catch (sig) - int sig; + int sig ATTRIBUTE_UNUSED; { signal (SIGSEGV, SIG_DFL); #ifdef SIGIOT diff -rup orig/egcs-19980508/gcc/cp/decl2.c egcs-19980508/gcc/cp/decl2.c --- orig/egcs-19980508/gcc/cp/decl2.c Thu May 7 22:05:50 1998 +++ egcs-19980508/gcc/cp/decl2.c Sun May 10 19:56:33 1998 @@ -3743,7 +3743,6 @@ merge_functions (s1, s2) tree s1; tree s2; { - tree tmp, tempn; if (TREE_CODE (s2) == OVERLOAD) while (s2) { diff -rup orig/egcs-19980508/gcc/cp/error.c egcs-19980508/gcc/cp/error.c --- orig/egcs-19980508/gcc/cp/error.c Thu May 7 22:05:51 1998 +++ egcs-19980508/gcc/cp/error.c Sun May 10 19:58:55 1998 @@ -1698,7 +1698,7 @@ type_as_string (typ, v) char * expr_as_string (decl, v) tree decl; - int v; + int v ATTRIBUTE_UNUSED; { OB_INIT (); @@ -1797,7 +1797,7 @@ cp_line_of (t) char * code_as_string (c, v) enum tree_code c; - int v; + int v ATTRIBUTE_UNUSED; { return tree_code_name [c]; } @@ -1805,7 +1805,7 @@ code_as_string (c, v) char * language_as_string (c, v) enum languages c; - int v; + int v ATTRIBUTE_UNUSED; { switch (c) { @@ -1825,7 +1825,8 @@ language_as_string (c, v) char * parm_as_string (p, v) - int p, v; + int p; + int v ATTRIBUTE_UNUSED; { if (p < 0) return "`this'"; @@ -1837,7 +1838,7 @@ parm_as_string (p, v) char * op_as_string (p, v) enum tree_code p; - int v; + int v ATTRIBUTE_UNUSED; { static char buf[] = "operator "; @@ -1851,7 +1852,7 @@ op_as_string (p, v) char * assop_as_string (p, v) enum tree_code p; - int v; + int v ATTRIBUTE_UNUSED; { static char buf[] = "operator "; @@ -1890,7 +1891,7 @@ args_as_string (p, v) char * cv_as_string (p, v) tree p; - int v; + int v ATTRIBUTE_UNUSED; { OB_INIT (); diff -rup orig/egcs-19980508/gcc/cp/lex.c egcs-19980508/gcc/cp/lex.c --- orig/egcs-19980508/gcc/cp/lex.c Thu May 7 22:05:59 1998 +++ egcs-19980508/gcc/cp/lex.c Sun May 10 20:02:29 1998 @@ -37,6 +37,7 @@ Boston, MA 02111-1307, USA. */ #include "obstack.h" #include "c-pragma.h" #include "toplev.h" +#include "output.h" /* MULTIBYTE_CHARS support only works for native compilers. ??? Ideally what we want is to model widechar support after diff -rup orig/egcs-19980508/gcc/cp/pt.c egcs-19980508/gcc/cp/pt.c --- orig/egcs-19980508/gcc/cp/pt.c Thu May 7 22:06:10 1998 +++ egcs-19980508/gcc/cp/pt.c Sun May 10 16:59:24 1998 @@ -5581,7 +5581,7 @@ type_unification (tparms, targs, parms, return 1; explicit_mask = alloca (sizeof (int) * TREE_VEC_LENGTH (targs)); - bzero (explicit_mask, sizeof(int) * TREE_VEC_LENGTH (targs)); + bzero ((char *) explicit_mask, sizeof(int) * TREE_VEC_LENGTH (targs)); for (i = 0; i < TREE_VEC_LENGTH (arg_vec) diff -rup orig/egcs-19980508/gcc/cp/search.c egcs-19980508/gcc/cp/search.c --- orig/egcs-19980508/gcc/cp/search.c Thu May 7 22:06:13 1998 +++ egcs-19980508/gcc/cp/search.c Sun May 10 20:14:58 1998 @@ -3868,7 +3868,7 @@ dfs_check_overlap (empty_binfo) static int dfs_no_overlap_yet (t) - tree t; + tree t ATTRIBUTE_UNUSED; { return found_overlap == 0; } diff -rup orig/egcs-19980508/gcc/cp/tinfo.cc egcs-19980508/gcc/cp/tinfo.cc --- orig/egcs-19980508/gcc/cp/tinfo.cc Thu May 7 22:06:17 1998 +++ egcs-19980508/gcc/cp/tinfo.cc Sun May 10 20:42:22 1998 @@ -77,7 +77,7 @@ dcast (const type_info& desired, int is_ return objptr; void *match_found = 0; - for (int i = 0; i < n_bases; i++) + for (size_t i = 0; i < n_bases; i++) { if (is_public && base_list[i].access != PUBLIC) continue; diff -rup orig/egcs-19980508/gcc/cp/typeck.c egcs-19980508/gcc/cp/typeck.c --- orig/egcs-19980508/gcc/cp/typeck.c Thu May 7 22:06:21 1998 +++ egcs-19980508/gcc/cp/typeck.c Sun May 10 20:06:31 1998 @@ -6200,7 +6200,7 @@ build_x_modify_expr (lhs, modifycode, rh int language_lvalue_valid (exp) - tree exp; + tree exp ATTRIBUTE_UNUSED; { return 1; }