This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/47285] G format outputs wrong number of characters when decimal supplied in literal
- From: "jvdelisle at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 22 Jan 2011 13:54:24 +0000
- Subject: [Bug libfortran/47285] G format outputs wrong number of characters when decimal supplied in literal
- Auto-submitted: auto-generated
- References: <bug-47285-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47285
--- Comment #4 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2011-01-22 13:53:52 UTC ---
Created attachment 23076
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23076
A possible patch
This patch seems to be acceptable. I add a try return value to output float to
communicate when the field width is not successful. Oddly, I had to make an
adjustment to the exponent width to take care of a case that returns
successfully.
if (e > 4)\
e = 4;\
This seems to work, but I wonder if I have a latent bug within. This patch does
regression test OK. I thought I would let others play with it before I submit.