From 77dc0938f72adc4ef75f164fe290deeb236b32eb Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Tue, 19 May 1998 07:19:17 +0000 Subject: [PATCH] Warning fixes: * Makefile.in (parse.o): Depend on toplev.h. * class.c (typecode_p): Remove prototype and definition. * cp-tree.h (currently_open_class, is_empty_class, member_p): Add prototype. * decl.c (push_overloaded_decl_top_level): Remove prototype and definition. * errfn.c (cp_error): Cast function pointer `error' to (errorfn *) in call to `cp_thing'. (cp_warning): Likewise for function pointer `warning'. * except.c (do_function_call): Remove prototype and definition. (call_eh_info): Wrap variable `t1' in macro NEW_EH_MODEL. * method.c (is_java_type): Add prototype and make it static. * parse.y: Include toplev.h. * pt.c (type_unification): Remove unused variable `arg'. (instantiate_decl): likewise for `save_ti'. * tree.c (propagate_binfo_offsets): Likewise for `base_binfos'. From-SVN: r19866 --- gcc/cp/ChangeLog | 28 ++++++++++++++++++++++++++++ gcc/cp/Makefile.in | 3 ++- gcc/cp/class.c | 11 ----------- gcc/cp/cp-tree.h | 3 +++ gcc/cp/decl.c | 16 ---------------- gcc/cp/errfn.c | 4 ++-- gcc/cp/except.c | 22 ++++------------------ gcc/cp/method.c | 3 ++- gcc/cp/parse.c | 1 + gcc/cp/parse.y | 1 + gcc/cp/pt.c | 2 -- gcc/cp/tree.c | 1 - 12 files changed, 43 insertions(+), 52 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3fe8d44d35f6..e02f940322e5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,31 @@ +Tue May 19 10:05:02 1998 Kaveh R. Ghazi + + * Makefile.in (parse.o): Depend on toplev.h. + + * class.c (typecode_p): Remove prototype and definition. + + * cp-tree.h (currently_open_class, is_empty_class, member_p): + Add prototype. + + * decl.c (push_overloaded_decl_top_level): Remove prototype and + definition. + + * errfn.c (cp_error): Cast function pointer `error' to (errorfn *) + in call to `cp_thing'. + (cp_warning): Likewise for function pointer `warning'. + + * except.c (do_function_call): Remove prototype and definition. + (call_eh_info): Wrap variable `t1' in macro NEW_EH_MODEL. + + * method.c (is_java_type): Add prototype and make it static. + + * parse.y: Include toplev.h. + + * pt.c (type_unification): Remove unused variable `arg'. + (instantiate_decl): likewise for `save_ti'. + + * tree.c (propagate_binfo_offsets): Likewise for `base_binfos'. + Tue May 19 02:43:25 1998 Jason Merrill * init.c (build_member_call): Handle template_ids. diff --git a/gcc/cp/Makefile.in b/gcc/cp/Makefile.in index edcaa1c09935..85bb833d4e12 100644 --- a/gcc/cp/Makefile.in +++ b/gcc/cp/Makefile.in @@ -208,7 +208,8 @@ PARSE_H = $(srcdir)/parse.h PARSE_C = $(srcdir)/parse.c parse.o : $(PARSE_C) $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h lex.h \ - $(srcdir)/../except.h $(srcdir)/../output.h $(srcdir)/../system.h + $(srcdir)/../except.h $(srcdir)/../output.h $(srcdir)/../system.h \ + $(srcdir)/../toplev.h $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \ `echo $(PARSE_C) | sed 's,^\./,,'` diff --git a/gcc/cp/class.c b/gcc/cp/class.c index b6ca77e7c322..e7a9251d332b 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -90,7 +90,6 @@ static tree get_vfield_name PROTO((tree)); static void finish_struct_anon PROTO((tree)); static tree build_vbase_pointer PROTO((tree, tree)); static int complete_type_p PROTO((tree)); -static int typecode_p PROTO((tree, enum tree_code)); static tree build_vtable_entry PROTO((tree, tree)); static tree get_vtable_name PROTO((tree)); static tree get_derived_offset PROTO((tree, tree)); @@ -1728,16 +1727,6 @@ finish_base_struct (t, b) return first_vfn_base_index; } - -static int -typecode_p (type, code) - tree type; - enum tree_code code; -{ - return (TREE_CODE (type) == code - || (TREE_CODE (type) == REFERENCE_TYPE - && TREE_CODE (TREE_TYPE (type)) == code)); -} /* Set memoizing fields and bits of T (and its variants) for later use. MAX_HAS_VIRTUAL is the largest size of any T's virtual function tables. */ diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 17e3ac8020a7..a42ac73b1c3d 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -2141,6 +2141,7 @@ extern tree build_vbase_path PROTO((enum tree_code, tree, tree, tree, int)); extern tree build_vtbl_ref PROTO((tree, tree)); extern tree build_vfn_ref PROTO((tree *, tree, tree)); extern void add_method PROTO((tree, tree *, tree)); +extern int currently_open_class PROTO((tree)); extern tree get_vfield_offset PROTO((tree)); extern void duplicate_tag_error PROTO((tree)); extern tree finish_struct PROTO((tree, tree, tree, int)); @@ -2148,6 +2149,7 @@ extern tree finish_struct_1 PROTO((tree, int)); extern tree finish_struct_methods PROTO((tree, tree, int)); extern int resolves_to_fixed_type_p PROTO((tree, int *)); extern void init_class_processing PROTO((void)); +extern int is_empty_class PROTO((tree)); extern void pushclass PROTO((tree, int)); extern void popclass PROTO((int)); extern void push_nested_class PROTO((tree, int)); @@ -2684,6 +2686,7 @@ extern int yylex PROTO((void)); extern tree arbitrate_lookup PROTO((tree, tree, tree)); /* in tree.c */ +extern int member_p PROTO((tree)); extern int real_lvalue_p PROTO((tree)); extern tree build_min PVPROTO((enum tree_code, tree, ...)); extern tree build_min_nt PVPROTO((enum tree_code, ...)); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 4b728a05a8d7..d5816f43bac2 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -132,7 +132,6 @@ static tree grokparms PROTO((tree, int)); static tree lookup_nested_type PROTO((tree, tree)); static char *redeclaration_error_message PROTO((tree, tree)); static tree push_overloaded_decl PROTO((tree, int)); -static void push_overloaded_decl_top_level PROTO((tree, int)); static struct stack_level *push_decl_level PROTO((struct stack_level *, struct obstack *)); @@ -3677,21 +3676,6 @@ pushdecl_top_level (x) return x; } -/* Like push_overloaded_decl, only it places X in GLOBAL_BINDING_LEVEL, - if appropriate. */ - -static void -push_overloaded_decl_top_level (x, forget) - tree x; - int forget; -{ - struct binding_level *b = current_binding_level; - - current_binding_level = global_binding_level; - push_overloaded_decl (x, forget); - current_binding_level = b; -} - /* Make the declaration of X appear in CLASS scope. */ tree diff --git a/gcc/cp/errfn.c b/gcc/cp/errfn.c index 4546e1954cb2..60a024f285c0 100644 --- a/gcc/cp/errfn.c +++ b/gcc/cp/errfn.c @@ -200,7 +200,7 @@ DECLARE (cp_error) va_list ap; INIT; if (! cp_silent) - cp_thing (error, 0, format, ap); + cp_thing ((errorfn *) error, 0, format, ap); va_end (ap); } @@ -209,7 +209,7 @@ DECLARE (cp_warning) va_list ap; INIT; if (! cp_silent) - cp_thing (warning, 0, format, ap); + cp_thing ((errorfn *) warning, 0, format, ap); va_end (ap); } diff --git a/gcc/cp/except.c b/gcc/cp/except.c index 5b6831471a54..89dee7ee19c9 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -45,7 +45,6 @@ tree builtin_return_address_fndecl; /* A couple of backend routines from m88k.c */ static void push_eh_cleanup PROTO((void)); -static rtx do_function_call PROTO((tree, tree, tree)); static tree build_eh_type_type PROTO((tree)); static tree build_eh_type PROTO((tree)); static void expand_end_eh_spec PROTO((tree)); @@ -182,22 +181,6 @@ extern tree const_ptr_type_node; /* ========================================================================= */ -/* Cheesyness to save some typing. Returns the return value rtx. */ - -static rtx -do_function_call (func, params, return_type) - tree func, params, return_type; -{ - tree func_call; - func_call = build_function_call (func, params); - expand_call (func_call, NULL_RTX, 0); - if (return_type != NULL_TREE) - return hard_function_value (return_type, func_call); - return NULL_RTX; -} - -/* ========================================================================= */ - /* sets up all the global eh stuff that needs to be initialized at the start of compilation. @@ -267,7 +250,10 @@ call_eh_info () fn = IDENTIFIER_GLOBAL_VALUE (fn); else { - tree t1,t, fields[7]; +#ifdef NEW_EH_MODEL + tree t1; +#endif + tree t, fields[7]; int fo = 0; /* Declare cp_eh_info * __cp_exception_info (void), diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 5ebcac9e65f3..5cf4133166d6 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -83,6 +83,7 @@ static int issue_ktype PROTO((tree)); static void build_overload_scope_ref PROTO((tree)); static void build_mangled_template_parm_index PROTO((char *, tree)); static int check_btype PROTO((tree)); +static int is_java_type PROTO((tree)); # define OB_INIT() (scratch_firstobj ? (obstack_free (&scratch_obstack, scratch_firstobj), 0) : 0) # define OB_PUTC(C) (obstack_1grow (&scratch_obstack, (C))) @@ -1117,7 +1118,7 @@ process_modifiers (parmtype) /* True iff TYPE was declared as a "Java" type (inside extern "Java"). */ -int +static int is_java_type (type) tree type; { diff --git a/gcc/cp/parse.c b/gcc/cp/parse.c index b87792d923b7..276dbb791603 100644 --- a/gcc/cp/parse.c +++ b/gcc/cp/parse.c @@ -107,6 +107,7 @@ #include "cp-tree.h" #include "output.h" #include "except.h" +#include "toplev.h" /* Since parsers are distinct for each language, put the language string definition here. (fnf) */ diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y index e66e4f93795c..70af50b77043 100644 --- a/gcc/cp/parse.y +++ b/gcc/cp/parse.y @@ -41,6 +41,7 @@ Boston, MA 02111-1307, USA. */ #include "cp-tree.h" #include "output.h" #include "except.h" +#include "toplev.h" /* Since parsers are distinct for each language, put the language string definition here. (fnf) */ diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index af27280b6e2b..43ab3d294bfb 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -5671,7 +5671,6 @@ type_unification (tparms, targs, parms, args, targs_in, unification_kind_t strict; int allow_incomplete; { - tree arg; int* explicit_mask; int i; @@ -6965,7 +6964,6 @@ instantiate_decl (d) tree args = TI_ARGS (ti); tree td; tree decl_pattern, code_pattern; - tree save_ti; int nested = in_function_p (); int d_defined; int pattern_defined; diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 2d07eee7d314..f2dd941fbb9d 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -570,7 +570,6 @@ propagate_binfo_offsets (binfo, offset) else { int j; - tree base_binfos = BINFO_BASETYPES (base_binfo); tree delta = NULL_TREE; for (j = i+1; j < n_baselinks; j++) -- 2.43.5