[Bug libfortran/48852] New: Invalid spaces in list-directed output of complex constants

thenlich at users dot sourceforge.net gcc-bugzilla@gcc.gnu.org
Tue May 3 12:49:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48852

           Summary: Invalid spaces in list-directed output of complex
                    constants
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: thenlich@users.sourceforge.net


There are invalid spaces in complex constants in list-directed output:

print *, (1.0, 0.0) ! " (  1.00000000    ,  0.00000000    )" expected "
(1.00000000,0.00000000)"

Fortran 2003/2008:
"Real constants are produced with the effect of either an F edit descriptor or
an E edit descriptor, depending on the magnitude x of the value and a range
10^d1 <= x < 10^d2, where d1 and d2 are processor-dependent integers. If the
magnitude x  is within this range or is zero, the constant is produced using
0PFw.d; otherwise, 1PEw.d Ee is used.

Complex constants are enclosed in parentheses with a separator between the real
and imaginary parts, each produced as defined above for real constants. The
separator is a comma if the decimal edit mode is POINT; it is a semicolon if
the decimal edit mode is COMMA. The end of a record may occur between the
separator and the imaginary part only if the entire constant is as long as, or
longer than, an entire record. The only embedded blanks permitted within a
complex constant are between the separator and the end of a record and one
blank at the beginning of the next record."

Part of the problem is caused by GFortran using Gw.dEe editing instead of the
Fw.d editing required by the standard (i.e. appending the n blanks at the end).
This is a waste of space for real constants and an outright bug for complex
constant.



More information about the Gcc-bugs mailing list