Found on the J3 mailing list. gfortran is the compiler which prints "0.0"as
second number (4.1 to 4.4); ifort, g95, NAG f95, openf95 and sunf95 print the
3742 twice.

Van Snyder writes:
--------------------------------------------------------
The list items in subclause 10.8.5 "P editing" of 08-007r2 that begin
"On output,..." are silent concerning the effect of P editing on F
editing for output.  The specification of the effect of P on F during
output is hiding in the first list item, which begins "On input,...."

With the little program

        program F_and_P

          print 1, 3742.0, 0.3742
        1 format ( f14.0, 4pf14.0 )

        end program F_and_P

five of my six compilers produce a program that (correctly) prints
         3742.         3742.
while one (incorrectly) prints
         3742.         0000.

This treatment of F and P interaction goes back to F66 (7.2.3.5.1,
7.2.3.6.2), F77 (13.5.7.1, 13.5.9.2.1), and f90/95 (10.6.5, 10.5.1.2.1).

The effect of P on F output would be more clearly explained in a
separate list item, say between the second and third items.  I don't
think it's possible to rearrange the first list item both to be correct
and not to hide either the input or output effect.


-- 
           Summary: Wrong I/O output: Interaction between F and P for output
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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

Reply via email to