This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

C++ warning patch


	This fixes some minor warning nits in the cp directory.
Bootstrapped on Irix6 and OSF4.  Okay to install?

		--Kaveh


1999-08-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* gxx.gperf (hash, is_reserved_word): Add prototypes.

	* init.c (build_vec_init): Initialize variable `try_block'.

	* lex.c (init_parse): Call memcpy, not bcopy, to avoid casts.
	Likewise for bzero/memset.
	(token_getch, token_put_back): Add prototypes.
	(retrofit_lang_decl): Call memset, not bzero, to avoid casts.

diff -rup orig/egcs-CVS19990828/gcc/cp/gxx.gperf egcs-CVS19990828/gcc/cp/gxx.gperf
--- orig/egcs-CVS19990828/gcc/cp/gxx.gperf	Thu Aug 12 07:43:02 1999
+++ egcs-CVS19990828/gcc/cp/gxx.gperf	Sat Aug 28 16:28:10 1999
@@ -1,7 +1,15 @@
 %{
-/* Command-line: gperf -L KR-C -F ', 0, 0' -p -j1 -g -o -t -N is_reserved_word -k1,4,$,7 gplus.gperf  */
+/* Command-line: gperf -L C -F ', 0, 0' -p -j1 -g -o -t -N is_reserved_word -k1,4,$,7 gplus.gperf  */
 %}
 struct resword { const char *name; short token; enum rid rid;};
+#ifdef __GNUC__
+__inline
+#endif
+static unsigned int hash PARAMS ((const char *, unsigned int));
+#ifdef __GNUC__
+__inline
+#endif
+struct resword *is_reserved_word PARAMS ((const char *, unsigned int));
 %%
 __alignof, ALIGNOF, RID_UNUSED
 __alignof__, ALIGNOF, RID_UNUSED
diff -rup orig/egcs-CVS19990828/gcc/cp/init.c egcs-CVS19990828/gcc/cp/init.c
--- orig/egcs-CVS19990828/gcc/cp/init.c	Thu Aug 26 07:42:26 1999
+++ egcs-CVS19990828/gcc/cp/init.c	Sat Aug 28 16:37:38 1999
@@ -2767,7 +2767,7 @@ build_vec_init (decl, base, maxindex, in
   tree stmt_expr;
   tree compound_stmt;
   int destroy_temps;
-  tree try_block;
+  tree try_block = NULL_TREE;
   int num_initialized_elts = 0;
 
   maxindex = cp_convert (ptrdiff_type_node, maxindex);
diff -rup orig/egcs-CVS19990828/gcc/cp/lex.c egcs-CVS19990828/gcc/cp/lex.c
--- orig/egcs-CVS19990828/gcc/cp/lex.c	Thu Aug 19 07:42:08 1999
+++ egcs-CVS19990828/gcc/cp/lex.c	Sat Aug 28 16:19:33 1999
@@ -533,20 +533,20 @@ init_parse (filename)
   init_cplus_unsave ();
   init_cplus_expand ();
 
-  bcopy (cplus_tree_code_type,
-	 tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE,
-	 (int)LAST_CPLUS_TREE_CODE - (int)LAST_AND_UNUSED_TREE_CODE);
-  bcopy ((char *)cplus_tree_code_length,
-	 (char *)(tree_code_length + (int) LAST_AND_UNUSED_TREE_CODE),
-	 (LAST_CPLUS_TREE_CODE - (int)LAST_AND_UNUSED_TREE_CODE) * sizeof (int));
-  bcopy ((char *)cplus_tree_code_name,
-	 (char *)(tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE),
-	 (LAST_CPLUS_TREE_CODE - (int)LAST_AND_UNUSED_TREE_CODE) * sizeof (char *));
+  memcpy (tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE,
+	  cplus_tree_code_type,
+	  (int)LAST_CPLUS_TREE_CODE - (int)LAST_AND_UNUSED_TREE_CODE);
+  memcpy (tree_code_length + (int) LAST_AND_UNUSED_TREE_CODE,
+	  cplus_tree_code_length,
+	  (LAST_CPLUS_TREE_CODE - (int)LAST_AND_UNUSED_TREE_CODE) * sizeof (int));
+  memcpy (tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE,
+	  cplus_tree_code_name,
+	  (LAST_CPLUS_TREE_CODE - (int)LAST_AND_UNUSED_TREE_CODE) * sizeof (char *));
 
   opname_tab = (const char **)oballoc ((int)LAST_CPLUS_TREE_CODE * sizeof (char *));
-  bzero ((char *)opname_tab, (int)LAST_CPLUS_TREE_CODE * sizeof (char *));
+  memset (opname_tab, 0, (int)LAST_CPLUS_TREE_CODE * sizeof (char *));
   assignop_tab = (const char **)oballoc ((int)LAST_CPLUS_TREE_CODE * sizeof (char *));
-  bzero ((char *)assignop_tab, (int)LAST_CPLUS_TREE_CODE * sizeof (char *));
+  memset (assignop_tab, 0, (int)LAST_CPLUS_TREE_CODE * sizeof (char *));
 
   ansi_opname[0] = get_identifier ("<invalid operator>");
   for (i = 0; i < (int) LAST_CPLUS_TREE_CODE; i++)
@@ -3459,6 +3459,8 @@ parse_float (data)
    next token, which screws up feed_input.  So just return a null
    character.  */
 
+inline int token_getch			PROTO ((void));
+
 inline int
 token_getch ()
 {
@@ -3469,6 +3471,8 @@ token_getch ()
   return getch ();
 }
 
+inline void token_put_back		PROTO ((int));
+
 inline void
 token_put_back (ch)
      int ch;
@@ -4781,7 +4785,7 @@ retrofit_lang_decl (t)
   else
     ld = (struct lang_decl *) obstack_alloc (obstack, size);
 
-  bzero (ld, size);
+  memset (ld, 0, size);
 
   DECL_LANG_SPECIFIC (t) = ld;
   LANG_DECL_PERMANENT (ld) = obstack == &permanent_obstack;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]