A patch for more constification

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Mon Jan 25 14:44:00 GMT 1999


 > Sun Jan 24 09:54:16 1999  Kaveh R. Ghazi  
 > 
 >         * bitmap.c (bitmap_print): Qualify a char* with the `const' keyword.
 > 
 >         * bitmap.h (bitmap_print): Likewise.
 > 
 >         * c-decl.c (redeclaration_error_message, duplicate_decls,
 >         pushdecl, builtin_function, grokdeclarator, grokfield): Likewise.
 > 
 >         * c-lang.c (build_objc_string): Likewise.
 > 
 >         * c-lex.c (yyerror): Likewise.
 > 
 >         * c-lex.h (yyerror): Likewise.
 > 
 >         * c-pragma.c (handle_pragma_token): Likewise.
 > 
 >         * c-pragma.h (handle_pragma_token): Likewise.
 > 
 >         * c-tree.h (build_objc_string, builtin_function, grokfield,
 >         build_indirect_ref, lvalue_or_else, readonly_warning, error_init,
 >         pedwarn_init): Likewise.
 > 
 >         * c-typeck.c (convert_for_assignment, warn_for_assignment,
 >         push_string, get_spelling, warning_init, incomplete_type_error,
 >         build_indirect_ref, build_unary_op, lvalue_or_else,
 >         readonly_warning, build_c_cast, convert_for_assignment,
 >         warn_for_assignment, spelling, push_member_name, print_spelling,
 >         error_init, pedwarn_init, start_init): Likewise.
 > 
 >         * objc/objc-act.c (build_objc_string): Likewise.
 > 
 >         * print-tree.c (print_node_brief, print_node): Likewise.
 > 
 >         * tree.h (lvalue_or_else, print_node, print_node_brief): Likewise.
 > 

	When applying the above patch, one must also apply the following
because `lvalue_or_else' is reprototyped and redefined in the cp/
directory.  When the copy in gcc/tree.h is constified, the cp/ dir one
must be also. 

		--Kaveh


diff -rup orig/egcs-CVS19990123/gcc/cp/cp-tree.h egcs-CVS19990123/gcc/cp/cp-tree.h
--- orig/egcs-CVS19990123/gcc/cp/cp-tree.h	Sat Jan 23 23:56:27 1999
+++ egcs-CVS19990123/gcc/cp/cp-tree.h	Sun Jan 24 10:17:18 1999
@@ -3244,7 +3244,6 @@ extern tree build_min				PVPROTO((enum t
 extern tree build_min_nt			PVPROTO((enum tree_code, ...));
 extern tree min_tree_cons			PROTO((tree, tree, tree));
 extern int lvalue_p				PROTO((tree));
-extern int lvalue_or_else			PROTO((tree, char *));
 extern tree build_cplus_new			PROTO((tree, tree));
 extern tree get_target_expr			PROTO((tree));
 extern tree break_out_cleanups			PROTO((tree));
diff -rup test/egcs-CVS19990123/gcc/cp/tree.c egcs-CVS19990123/gcc/cp/tree.c
--- test/egcs-CVS19990123/gcc/cp/tree.c	Sat Jan 23 23:56:29 1999
+++ egcs-CVS19990123/gcc/cp/tree.c	Sun Jan 24 10:29:27 1999
@@ -170,7 +170,7 @@ lvalue_p (ref)
 int
 lvalue_or_else (ref, string)
      tree ref;
-     char *string;
+     const char *string;
 {
   int win = lvalue_p (ref);
   if (! win)




More information about the Gcc-patches mailing list