[Patch, libgfortran] Improvement to float output

Jerry DeLisle jvdelisle@verizon.net
Mon Apr 3 07:02:00 GMT 2006


The attached patch checks for zero precision of formatted output of floats and 
outputs asterisks for e,g, and d formats.

With the following program gfortran currently gives a runtime internal error 
stating:

Internal Error: printf is broken

Which is not true.

program test
  50 FORMAT (g20.0)
  print '(a)', "01234567890123456789"
  write(*,50) -8.0D0
end program test

I would count the fix as simple and obvious.  With this patch, the output is:

01234567890123456789
********************

This follows ifort example.

I will commit to trunk as obvious in a day or so unless objections.

NIST tested, regression tested.

Regards,

Jerry

2006-04-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* io/write.c (output_float): Add test for case of zero digits
	specified in fmt_d, fmt_e, and fmt_g and output asterisks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: output_float.diff
Type: text/x-patch
Size: 764 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060403/436c3ab5/attachment.bin>


More information about the Gcc-patches mailing list