This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/44934] [4.6 Regression] Bogus "Missing format for FORMATTED data transfer"
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Jul 2010 17:32:51 -0000
- Subject: [Bug fortran/44934] [4.6 Regression] Bogus "Missing format for FORMATTED data transfer"
- References: <bug-44934-12313@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from burnus at gcc dot gnu dot org 2010-07-14 17:32 -------
I think we agree that the code is invalid. But I also would prefer a message
such as GCC 4.5 had:
At line 4 of file aa.f90 (unit = 8, file = 'fort.8')
Fortran runtime error: End of file
The commit causing this diagnostics regression is probably Rev. : for PR
libfortran/44477, cf. http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161021
Actually, I am expecting the following error message from data_transfer_init:
+ if (dtp->u.p.current_unit->flags.access == ACCESS_SEQUENTIAL)
+ if (dtp->u.p.current_unit->endfile == AFTER_ENDFILE)
+ {
+ generate_error (&dtp->common, LIBERROR_OPTION_CONFLICT,
+ "Sequential READ or WRITE not allowed after "
+ "EOF marker, possibly use REWIND or BACKSPACE");
However,
(gdb) p dtp->u.p.current_unit->endfile
$2 = NO_ENDFILE
By the way, I think that check should be moved before the format checks.
Another question is why is the file marked as FORMATTED? "READ (unit)" should
be unformatted, shouldn't it? And the file has not been explicitly opened for
formatted I/O. Or have I missed some I/O fine print?
p dtp->u.p.current_unit->flags.form
$3 = FORM_FORMATTED
p dtp->common.flags
$5 = 0
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44934