This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch, libgfortran] PR31052 Bad IOSTAT values when readings NAMELISTs past EOF


I will commit the following patch under the obvious and simple rule to trunk.

This fixes the latest test case for pr31052 and does not break the SPEC benchmark. Namelist fails without this patch which avoids the call to test_endfile. SPEC fails without the call to test_endfile.

I will, as I have time, work up a suitable testcase. (see the pr for the test case involved) I also will try to get the publicly available six.f program to compile and run and see if I can determine any better approach to all this. For now it fixes the problem.

Regards,

Jerry

Index: io/transfer.c
===================================================================
*** io/transfer.c       (revision 123253)
--- io/transfer.c       (working copy)
*************** next_record_r (st_parameter_dt *dtp)
*** 2228,2234 ****
        break;
      }

!   if (dtp->u.p.current_unit->flags.access == ACCESS_SEQUENTIAL)
      test_endfile (dtp->u.p.current_unit);
  }

--- 2228,2235 ----
        break;
      }

!   if (dtp->u.p.current_unit->flags.access == ACCESS_SEQUENTIAL
!       && !dtp->u.p.namelist_mode)
      test_endfile (dtp->u.p.current_unit);
  }




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]