From 7dee3f36c6feef2bc456ac5f578412d14d205e43 Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Wed, 13 May 1998 10:00:46 +0000 Subject: [PATCH] Warning patches: * 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. From-SVN: r19707 --- gcc/cp/ChangeLog | 36 ++++++++++++++++++++++++++++++++++++ gcc/cp/Makefile.in | 3 ++- gcc/cp/call.c | 3 --- gcc/cp/cp-tree.h | 1 + gcc/cp/decl.c | 2 +- gcc/cp/decl2.c | 1 - gcc/cp/error.c | 15 ++++++++------- gcc/cp/lex.c | 1 + gcc/cp/pt.c | 2 +- gcc/cp/search.c | 2 +- gcc/cp/tinfo.cc | 2 +- gcc/cp/typeck.c | 2 +- 12 files changed, 53 insertions(+), 17 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a2742a5414e..8cfb061f664 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,39 @@ +Wed May 13 12:54:30 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. + Tue May 12 21:37:49 1998 Jason Merrill * error.c (dump_simple_decl): Use DECL_CLASS_SCOPE_P and/or diff --git a/gcc/cp/Makefile.in b/gcc/cp/Makefile.in index c917e601cb8..869023d15d8 100644 --- a/gcc/cp/Makefile.in +++ b/gcc/cp/Makefile.in @@ -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 --git a/gcc/cp/call.c b/gcc/cp/call.c index fa02408ff68..a5c16e9617f 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -1095,7 +1095,6 @@ add_function_candidate (candidates, fn, arglist, flags) 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. */ @@ -1183,7 +1182,6 @@ add_conv_candidate (candidates, fn, obj, arglist) tree parmnode = parmlist; tree argnode = arglist; int viable = 1; - struct z_candidate *cand; int flags = LOOKUP_NORMAL; for (i = 0; i < len; ++i) @@ -1243,7 +1241,6 @@ build_builtin_candidate (candidates, fnname, type1, type2, { tree t, convs; int viable = 1, i; - struct z_candidate *cand; tree types[2]; types[0] = type1; diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 3461bdb5fbf..183578bcf69 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -2570,6 +2570,7 @@ extern tree build_dynamic_cast PROTO((tree, tree)); 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 --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 4650bf4fce2..287c8ad430c 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -5002,7 +5002,7 @@ lookup_name_current_level (name) static void signal_catch (sig) - int sig; + int sig ATTRIBUTE_UNUSED; { signal (SIGSEGV, SIG_DFL); #ifdef SIGIOT diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 927efb89563..200ace42831 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -3743,7 +3743,6 @@ merge_functions (s1, s2) tree s1; tree s2; { - tree tmp, tempn; if (TREE_CODE (s2) == OVERLOAD) while (s2) { diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 61739211bb5..9ec1f28f0e3 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -1706,7 +1706,7 @@ type_as_string (typ, v) char * expr_as_string (decl, v) tree decl; - int v; + int v ATTRIBUTE_UNUSED; { OB_INIT (); @@ -1804,7 +1804,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]; } @@ -1812,7 +1812,7 @@ code_as_string (c, v) char * language_as_string (c, v) enum languages c; - int v; + int v ATTRIBUTE_UNUSED; { switch (c) { @@ -1832,7 +1832,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'"; @@ -1844,7 +1845,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 "; @@ -1858,7 +1859,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 "; @@ -1897,7 +1898,7 @@ args_as_string (p, v) char * cv_as_string (p, v) tree p; - int v; + int v ATTRIBUTE_UNUSED; { OB_INIT (); diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 57707aa3fd0..36a03683a5f 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -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 --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 5b860abed4a..e9938770d6e 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -5684,7 +5684,7 @@ type_unification (tparms, targs, parms, args, targs_in, 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 --git a/gcc/cp/search.c b/gcc/cp/search.c index 08291a892a3..c4b1b6729d6 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -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 --git a/gcc/cp/tinfo.cc b/gcc/cp/tinfo.cc index 3f320817504..4b68fd1b3fb 100644 --- a/gcc/cp/tinfo.cc +++ b/gcc/cp/tinfo.cc @@ -77,7 +77,7 @@ dcast (const type_info& desired, int is_public, void *objptr, 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 --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index fe66a3b815e..27a9c6e010d 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -6220,7 +6220,7 @@ build_x_modify_expr (lhs, modifycode, rhs) int language_lvalue_valid (exp) - tree exp; + tree exp ATTRIBUTE_UNUSED; { return 1; } -- 2.30.2