C++ Patch: possible bug pointed out by non-literal format warning

Richard Henderson rth@cygnus.com
Thu Jan 27 13:55:00 GMT 2000


On Thu, Jan 27, 2000 at 03:30:47PM -0500, Kaveh R. Ghazi wrote:
> -	      if (!format[0])
> -		sprintf (format, "%%x%%0%dx", HOST_BITS_PER_INT / 4);

Perhaps more of the same hackery?

	sprintf (format, "%s%%0%d%s", HOST_WIDE_INT_PRINT_HEX,
		 HOST_BITS_PER_WIDE_INT / 4,
		 strchr (HOST_WIDE_INT_PRINT_HEX, '%')+1);


r~


More information about the Gcc-patches mailing list