This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/47434] Wrong field width for NaN with (F0.n) formatting
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 27 Jan 2011 13:30:43 +0000
- Subject: [Bug libfortran/47434] Wrong field width for NaN with (F0.n) formatting
- Auto-submitted: auto-generated
- References: <bug-47434-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47434
--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-01-27 13:30:30 UTC ---
(In reply to comment #4)
> (In reply to comment #3)
> > Regarding the other cases:
> > Similarly for the '+' sign on Inf. Until now we have chosen to emit the
> > optional characters.
There seems to be a bug with regards to S:
print "(s,F0.2)", inf
still prints "+Inf". ("The edit descriptors SS, SP, and S set the sign mode
corresponding to the SIGN= specifier values SUPPRESS, PLUS, and
PROCESSOR_DEFINED, respectively.")
"(6) On output, with I, B, O, Z, F, and G editing, the specified value of the
field width w may be zero. In such cases, the processor selects the smallest
positive actual field width that does not result in a field filled with
asterisks" (10.7.2.1 General rules)
I have to agree with Thomas here: ".00" and "Inf" are the shorted possible
strings, unless SP (sign="PLUS") is used; then "+.00" and "+Inf" are the
shortest possible strings.
In that sense, none of my 10 compiler gets it right ...