Patch to use size_one_node when transforming fputs->fwrite

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Sat Jan 27 05:00:00 GMT 2001


The second argument to fwrite is a size_t, not an int.  I haven't seen
a failure, but the current code might lose in certain cases.

Bootstrap/testsuite on sparc-sun-solaris2.7, no regressions.

Ok to install?

		--Kaveh


2001-01-27  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* builtins.c (expand_builtin_fputs): Use size_one_node when
	transforming into fwrite.

--- orig/egcs-CVS20010125/gcc/builtins.c	Fri Jan 12 07:26:43 2001
+++ egcs-CVS20010125/gcc/builtins.c	Fri Jan 26 22:10:26 2001
@@ -3198,7 +3197,7 @@ expand_builtin_fputs (arglist, ignore)
 	   fwrite(string, 1, len, stream).  */
 	arglist = build_tree_list (NULL_TREE, TREE_VALUE (TREE_CHAIN (arglist)));
 	arglist = tree_cons (NULL_TREE, len, arglist);
-	arglist = tree_cons (NULL_TREE, integer_one_node, arglist);
+	arglist = tree_cons (NULL_TREE, size_one_node, arglist);
 	arglist = tree_cons (NULL_TREE, string_arg, arglist);
 	fn = fn_fwrite;
 	break;


More information about the Gcc-patches mailing list