public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/38439]  New: I/O PD edit descriptor inconsistency
@ 2008-12-07 21:35 burnus at gcc dot gnu dot org
  2008-12-08  0:53 ` [Bug fortran/38439] " jvdelisle at gcc dot gnu dot org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-12-07 21:35 UTC (permalink / raw)
  To: gcc-bugs

Found at
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/2fc107eda65d9065

The following code
      WRITE (*,'(1PD24.15E4)') 1.0d0
      end
is rejected in gfortran 4.2 to 4.4 with:
  Error: Period required in format specifier at (1)
(and ifort, NAG f95 and g95 also reject it).

It is accepted with openf95, sunf95 and gfortran 4.1 [the latter with a warning
matching the error message above], and it is said to be accepted with g77.

The compiled programs then prints:
 1.000000000000000D+0000  (note the "D")


Using the run-time version of the format string, i.e.
      character(len=25) :: str
      str = '(1PD24.15E4)'
      WRITE (*,str) 1.0d0
      end
it works with gfortran (4.1 to 4.4) and with g95.


The PD edit descriptor was always invalid according to the Fortran standard,
using '(1PE24.15E4)' works with all compilers and is valid (but it prints
"...E+0000" not "D").


The question is now whether
a) One accepts it with, e.g., -std=legacy. (The error message should then point
to the -std=legacy option)
-- or --
b) One checks whether on can get rid of the "D" support in libgfortran to save
some microseconds; libgfortran should then also print a run-time error message.


-- 
           Summary: I/O PD edit descriptor inconsistency
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          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=38439


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2009-10-12 13:42 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-07 21:35 [Bug fortran/38439] New: I/O PD edit descriptor inconsistency burnus at gcc dot gnu dot org
2008-12-08  0:53 ` [Bug fortran/38439] " jvdelisle at gcc dot gnu dot org
2008-12-25 19:47 ` jvdelisle at gcc dot gnu dot org
2009-01-21  6:51 ` jvdelisle at gcc dot gnu dot org
2009-01-22  3:05 ` jvdelisle at gcc dot gnu dot org
2009-01-22 10:55 ` burnus at gcc dot gnu dot org
2009-01-23  5:46 ` jvdelisle at gcc dot gnu dot org
2009-01-24 18:11 ` jvdelisle at gcc dot gnu dot org
2009-04-23  1:52 ` jvdelisle at gcc dot gnu dot org
2009-04-23  2:53 ` kargl at gcc dot gnu dot org
2009-10-11 17:38 ` jvdelisle at gcc dot gnu dot org
2009-10-11 17:41 ` jvdelisle at gcc dot gnu dot org
2009-10-11 19:20 ` jvdelisle at gcc dot gnu dot org
2009-10-12  0:53 ` jvdelisle at gcc dot gnu dot org
2009-10-12  0:54 ` jvdelisle at gcc dot gnu dot org
2009-10-12  7:39 ` dominiq at lps dot ens dot fr
2009-10-12 12:42 ` jvdelisle at gcc dot gnu dot org
2009-10-12 13:32 ` dominiq at lps dot ens dot fr
2009-10-12 13:42 ` jvdelisle at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).