public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/49296] New: [4.6/4.7 Regression] Wrong I/O END OF FILE
@ 2011-06-06  6:16 burnus at gcc dot gnu.org
  2011-06-06  6:16 ` [Bug fortran/49296] " burnus at gcc dot gnu.org
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-06-06  6:16 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [4.6/4.7 Regression] Wrong I/O END OF FILE
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
                CC: jvdelisle@gcc.gnu.org


Reported by Reinhold Bader (LRZ). The following program prints with gfortran
4.5 (and ifort 11, NAG 5.1, g95, pathf95):
 OK

With gfortran 4.6/4.7, it prints:

At line 11 of file read_listdir_01_pos.f90 (unit = 20, file = 'read.dat')
Fortran runtime error: End of file


--------- C part of the test program -----------

#include <stdio.h>

void genfil() {
    FILE *fp;

    fp = fopen("read.dat", "w+");
    fprintf(fp, "abcd efgh");
    fclose(fp);
}


--------- Fortran part of the test program -----------

program read_listdir_01_pos
  implicit none
  integer, parameter :: strmx = 255
  character(len=strmx) :: s1, s2
  interface
     subroutine genfil() bind(c)
     end subroutine genfil
  end interface
  call genfil()
  open(unit=20, file='read.dat', form='FORMATTED', action='READ', status='OLD')
  read(20, fmt=*) s1, s2
  if (trim(s1) == "abcd" .and. trim(s2) == "efgh") then
     write(*, *) 'OK'
  else
     write(*, *) 'FAIL'
  end if
  close(20)
end program read_listdir_01_pos


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

end of thread, other threads:[~2011-07-13 18:54 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-06  6:16 [Bug fortran/49296] New: [4.6/4.7 Regression] Wrong I/O END OF FILE burnus at gcc dot gnu.org
2011-06-06  6:16 ` [Bug fortran/49296] " burnus at gcc dot gnu.org
2011-06-06  9:42 ` [Bug fortran/49296] [4.6/4.7 Regression] Wrong END OF FILE error for list-directed I/O with strings burnus at gcc dot gnu.org
2011-06-06 10:28 ` dominiq at lps dot ens.fr
2011-06-06 10:37 ` dominiq at lps dot ens.fr
2011-06-06 10:43 ` burnus at gcc dot gnu.org
2011-06-06 12:12 ` dominiq at lps dot ens.fr
2011-06-06 12:12 ` [Bug libfortran/49296] " dominiq at lps dot ens.fr
2011-06-06 12:21 ` jvdelisle at gcc dot gnu.org
2011-06-11  8:42 ` jb at gcc dot gnu.org
2011-06-12 13:47 ` rguenth at gcc dot gnu.org
2011-06-17 19:11 ` jb at gcc dot gnu.org
2011-06-18  7:53 ` jb at gcc dot gnu.org
2011-06-20 14:32 ` burnus at gcc dot gnu.org
2011-07-03 15:55 ` jb at gcc dot gnu.org
2011-07-03 16:01 ` jb at gcc dot gnu.org
2011-07-03 17:38 ` jb at gcc dot gnu.org
2011-07-03 17:40 ` jb at gcc dot gnu.org
2011-07-13 18:48 ` jb at gcc dot gnu.org
2011-07-13 18:53 ` jb at gcc dot gnu.org
2011-07-13 18:54 ` jb at gcc dot gnu.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).