This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
egcs, more c++/g++ warning patches
- To: egcs-patches at cygnus dot com
- Subject: egcs, more c++/g++ warning patches
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Mon, 28 Sep 1998 09:32:22 -0400 (EDT)
- Cc: jason at cygnus dot com
Jason,
Here are some more warning patches for the gcc/cp directory.
Okay to install?
--Kaveh
Sun Sep 27 20:58:43 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (spew.o): Depend on toplev.h.
* call.c (compare_ics): Initialize variables `deref_from_type2',
`deref_to_type1' and `deref_to_type2'.
* decl.c (init_decl_processing): Remove unused variable
`ptr_ftype_void'.
* except.c (get_eh_type): Hide prototype and definition.
(process_start_catch_block_old): Remove unused static prototype.
* pt.c (tsubst_decl): Initialize variable `argvec'.
* spew.c: Include toplev.h.
diff -rup orig/egcs-CVS19980927/gcc/cp/Makefile.in egcs-CVS19980927/gcc/cp/Makefile.in
--- orig/egcs-CVS19980927/gcc/cp/Makefile.in Sun Sep 27 18:25:35 1998
+++ egcs-CVS19980927/gcc/cp/Makefile.in Sun Sep 27 21:14:44 1998
@@ -243,8 +243,8 @@ $(srcdir)/hash.h:
gperf -p -j1 -g -o -t -N is_reserved_word '-k1,4,7,$$' \
$(srcdir)/gxx.gperf >$(srcdir)/hash.h
-spew.o : spew.c $(CONFIG_H) $(CXX_TREE_H) \
- $(PARSE_H) $(srcdir)/../flags.h lex.h $(srcdir)/../system.h
+spew.o : spew.c $(CONFIG_H) $(CXX_TREE_H) $(PARSE_H) $(srcdir)/../flags.h \
+ lex.h $(srcdir)/../system.h $(srcdir)/../toplev.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 \
diff -rup orig/egcs-CVS19980927/gcc/cp/call.c egcs-CVS19980927/gcc/cp/call.c
--- orig/egcs-CVS19980927/gcc/cp/call.c Sun Sep 27 18:25:40 1998
+++ egcs-CVS19980927/gcc/cp/call.c Sun Sep 27 21:08:24 1998
@@ -3897,9 +3896,9 @@ compare_ics (ics1, ics2)
tree to_type1;
tree to_type2;
tree deref_from_type1 = NULL_TREE;
- tree deref_from_type2;
- tree deref_to_type1;
- tree deref_to_type2;
+ tree deref_from_type2 = NULL_TREE;
+ tree deref_to_type1 = NULL_TREE;
+ tree deref_to_type2 = NULL_TREE;
/* REF_BINDING is non-zero if the result of the conversion sequence
is a reference type. In that case TARGET_TYPE is the
diff -rup orig/egcs-CVS19980927/gcc/cp/decl.c egcs-CVS19980927/gcc/cp/decl.c
--- orig/egcs-CVS19980927/gcc/cp/decl.c Sun Sep 27 18:25:46 1998
+++ egcs-CVS19980927/gcc/cp/decl.c Sun Sep 27 21:09:41 1998
@@ -5507,7 +5507,7 @@ init_decl_processing ()
tree string_ftype_ptr_ptr, int_ftype_string_string;
tree sizetype_endlink;
tree ptr_ftype, ptr_ftype_unsigned, ptr_ftype_sizetype;
- tree void_ftype, void_ftype_int, void_ftype_ptr, ptr_ftype_void;
+ tree void_ftype, void_ftype_int, void_ftype_ptr;
/* Have to make these distinct before we try using them. */
lang_name_cplusplus = get_identifier ("C++");
diff -rup orig/egcs-CVS19980927/gcc/cp/except.c egcs-CVS19980927/gcc/cp/except.c
--- orig/egcs-CVS19980927/gcc/cp/except.c Sun Sep 27 18:25:49 1998
+++ egcs-CVS19980927/gcc/cp/except.c Sun Sep 27 21:59:21 1998
@@ -52,12 +52,13 @@ static tree call_eh_info PROTO((void));
static void push_eh_info PROTO((void));
static tree get_eh_info PROTO((void));
static tree get_eh_value PROTO((void));
+#if 0
static tree get_eh_type PROTO((void));
+#endif
static tree get_eh_caught PROTO((void));
static tree get_eh_handlers PROTO((void));
static tree do_pop_exception PROTO((void));
static void process_start_catch_block PROTO((tree, tree));
-static void process_start_catch_block_old PROTO((tree, tree));
static tree build_eh_type_type_ref PROTO((tree));
static tree build_terminate_handler PROTO((void));
static tree alloc_eh_object PROTO((tree));
@@ -360,12 +361,14 @@ get_eh_value ()
/* Returns a reference to the current exception type. */
+#if 0
static tree
get_eh_type ()
{
return build_component_ref (get_eh_info (), get_identifier ("type"),
NULL_TREE, 0);
}
+#endif
/* Returns a reference to whether or not the current exception
has been caught. */
diff -rup orig/egcs-CVS19980927/gcc/cp/pt.c egcs-CVS19980927/gcc/cp/pt.c
--- orig/egcs-CVS19980927/gcc/cp/pt.c Sun Sep 27 18:26:00 1998
+++ egcs-CVS19980927/gcc/cp/pt.c Sun Sep 27 21:11:24 1998
@@ -5026,7 +5026,7 @@ tsubst_decl (t, args, type, in_decl)
case FUNCTION_DECL:
{
tree ctx;
- tree argvec;
+ tree argvec = NULL_TREE;
tree gen_tmpl;
int member;
int args_depth;
diff -rup orig/egcs-CVS19980927/gcc/cp/spew.c egcs-CVS19980927/gcc/cp/spew.c
--- orig/egcs-CVS19980927/gcc/cp/spew.c Sun Sep 27 18:26:02 1998
+++ egcs-CVS19980927/gcc/cp/spew.c Sun Sep 27 21:13:54 1998
@@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA. */
#include "parse.h"
#include "flags.h"
#include "obstack.h"
+#include "toplev.h"
/* This takes a token stream that hasn't decided much about types and
tries to figure out as much as it can, with excessive lookahead and