[Bug libfortran/43320] [4.5 Regression] 200.sixtrack fails setup

jvdelisle at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Mar 11 01:56:00 GMT 2010



------- Comment #10 from jvdelisle at gcc dot gnu dot org  2010-03-11 01:56 -------
I plan to commit the following as a compromise.  We have had several PRs here
that contradict.  Not surprising really.  The compromise is to use item_count
to decide whether to hit_eof or not.  We could also do this with a compiler
flag.  This patch allows the test case in comment 6 to hit the eof if we have
not read any data items.  At the other end of this is PR26661 and PR26880.

All of these involve missing EOR at the end of a file.  Some want the EOF to be
interpreted as the EOR and some don't.  As a follow-up patch I am wondering if
we should treat the missing EOR at EOF as an EOR with -std=legacy and default
to giving an EOF otherwise.  In the meantime, this patch keeps things running
and really is not too unreasonable, though it seems hackish.  At least we know
where to make the tweaks if we choose to do so.

Index: transfer.c
===================================================================
--- transfer.c  (revision 157310)
+++ transfer.c  (working copy)
@@ -2810,6 +2810,8 @@
                {
                   if (errno != 0)
                     generate_error (&dtp->common, LIBERROR_OS, NULL);
+                 else if (dtp->u.p.item_count == 1)
+                   hit_eof (dtp);
                  break;
                 }



-- 


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



More information about the Gcc-bugs mailing list