public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/37083]  New: See Bug 33400 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33400)
@ 2008-08-11 19:53 tibor at atlas dot cz
  2008-08-12  0:28 ` [Bug fortran/37083] " jvdelisle at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: tibor at atlas dot cz @ 2008-08-11 19:53 UTC (permalink / raw)
  To: gcc-bugs

It seems that bug 33400 is not fixed in mingw32 version of gfortran (winXP):

Missplaced END-OF-FILE when reading file without a line terminator on
the last line, e.g.

REAL :: a, b, c
OPEN(UNIT=10,FILE='input')
READ(10,*) a, b, c
PRINT*, a*b*c
END

(file 'input' created with notepad -- without line break after last line)

IF file 'input' doesnt contain line terminator on
the last line, program crashes with:

At line 3 of file nt.f90 (unit = 10, file = 'input')
Fortran runtime error: End of file


-- 
           Summary: See Bug 33400
                    (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33400)
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tibor at atlas dot cz
 GCC build triplet: i586-pc-mingw32


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


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

* [Bug fortran/37083] See Bug 33400 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33400)
  2008-08-11 19:53 [Bug fortran/37083] New: See Bug 33400 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33400) tibor at atlas dot cz
@ 2008-08-12  0:28 ` jvdelisle at gcc dot gnu dot org
  2008-08-17 19:05 ` [Bug fortran/37083] Formatted read of line without trailing new-line fails (Windows; CR-LF issue?) jvdelisle at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-08-12  0:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jvdelisle at gcc dot gnu dot org  2008-08-12 00:27 -------
Without looking at a thing I will guess this is a CR-LF issue.  I will have a
look.


-- 


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


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

* [Bug fortran/37083] Formatted read of line without trailing new-line fails (Windows; CR-LF issue?)
  2008-08-11 19:53 [Bug fortran/37083] New: See Bug 33400 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33400) tibor at atlas dot cz
  2008-08-12  0:28 ` [Bug fortran/37083] " jvdelisle at gcc dot gnu dot org
@ 2008-08-17 19:05 ` jvdelisle at gcc dot gnu dot org
  2008-08-17 19:22 ` [Bug fortran/37083] Formatted read of line without trailing new-line fails burnus at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-08-17 19:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jvdelisle at gcc dot gnu dot org  2008-08-17 19:03 -------
This is not platform specific.

g77 runs this test case without error.  gfortran is attempting to read a
default formatted width and when it attempts to read the next character after
the last digit of the third line it does hit the EOF.

For the input file i used:

1.2
2.3
3.4

Since the End-Of_Record marker is missing, I am not sure what is valid.


-- 


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


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

* [Bug fortran/37083] Formatted read of line without trailing new-line fails
  2008-08-11 19:53 [Bug fortran/37083] New: See Bug 33400 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33400) tibor at atlas dot cz
  2008-08-12  0:28 ` [Bug fortran/37083] " jvdelisle at gcc dot gnu dot org
  2008-08-17 19:05 ` [Bug fortran/37083] Formatted read of line without trailing new-line fails (Windows; CR-LF issue?) jvdelisle at gcc dot gnu dot org
@ 2008-08-17 19:22 ` burnus at gcc dot gnu dot org
  2008-08-17 22:05 ` jvdelisle at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-08-17 19:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from burnus at gcc dot gnu dot org  2008-08-17 19:21 -------
Confirm. As Jerry pointed out it is not restricted to Windows.
I created my test case using:
   printf '1.2\n2.3\n3.4' > input

Fortran test case:
      REAL :: a, b, c
      OPEN(UNIT=10,FILE='input',access='stream',form='unformatted')
      write(10) '1.2'//achar(10)//'2.2'//achar(10)//'3.'
      call fputc(10,'3')
      close(10)
      open(unit=10,file='input',form='formatted')
      READ(10,*) a, b, c
      PRINT*, a*b*c
      END

The printf-generated test file works with g77, g95, NAG f95, ifort, sunf95 and
openf95. (Strictly speaking the standard presumably allows the gfortran
behaviour, nevertheless it should be fixed.)


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
  GCC build triplet|i586-pc-mingw32             |
   GCC host triplet|winXP 32bit                 |
 GCC target triplet|winXP 32bit                 |
   Last reconfirmed|0000-00-00 00:00:00         |2008-08-17 19:21:10
               date|                            |
            Summary|Formatted read of line      |Formatted read of line
                   |without trailing new-line   |without trailing new-line
                   |fails (Windows; CR-LF       |fails
                   |issue?)                     |


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


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

* [Bug fortran/37083] Formatted read of line without trailing new-line fails
  2008-08-11 19:53 [Bug fortran/37083] New: See Bug 33400 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33400) tibor at atlas dot cz
                   ` (2 preceding siblings ...)
  2008-08-17 19:22 ` [Bug fortran/37083] Formatted read of line without trailing new-line fails burnus at gcc dot gnu dot org
@ 2008-08-17 22:05 ` jvdelisle at gcc dot gnu dot org
  2008-10-12 23:28 ` jvdelisle at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-08-17 22:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jvdelisle at gcc dot gnu dot org  2008-08-17 22:04 -------
I have a patch testing.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jvdelisle at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-08-17 19:21:10         |2008-08-17 22:04:06
               date|                            |


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


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

* [Bug fortran/37083] Formatted read of line without trailing new-line fails
  2008-08-11 19:53 [Bug fortran/37083] New: See Bug 33400 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33400) tibor at atlas dot cz
                   ` (3 preceding siblings ...)
  2008-08-17 22:05 ` jvdelisle at gcc dot gnu dot org
@ 2008-10-12 23:28 ` jvdelisle at gcc dot gnu dot org
  2008-10-14  1:52 ` jvdelisle at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-10-12 23:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jvdelisle at gcc dot gnu dot org  2008-10-12 23:27 -------
Patch submitted for approval:

http://gcc.gnu.org/ml/fortran/2008-10/msg00098.html


-- 


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


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

* [Bug fortran/37083] Formatted read of line without trailing new-line fails
  2008-08-11 19:53 [Bug fortran/37083] New: See Bug 33400 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33400) tibor at atlas dot cz
                   ` (4 preceding siblings ...)
  2008-10-12 23:28 ` jvdelisle at gcc dot gnu dot org
@ 2008-10-14  1:52 ` jvdelisle at gcc dot gnu dot org
  2008-10-14  1:56 ` jvdelisle at gcc dot gnu dot org
  2008-10-14  3:26 ` jvdelisle at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-10-14  1:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jvdelisle at gcc dot gnu dot org  2008-10-14 01:51 -------
Subject: Bug 37083

Author: jvdelisle
Date: Tue Oct 14 01:49:51 2008
New Revision: 141101

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141101
Log:
2008-10-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org

        PR libfortran/37083
        * io/list_read.c (next_char): Simplify EOF tests and set endfile flag.
        (finish_list_read): Add EOF check.

Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/io/list_read.c


-- 


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


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

* [Bug fortran/37083] Formatted read of line without trailing new-line fails
  2008-08-11 19:53 [Bug fortran/37083] New: See Bug 33400 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33400) tibor at atlas dot cz
                   ` (5 preceding siblings ...)
  2008-10-14  1:52 ` jvdelisle at gcc dot gnu dot org
@ 2008-10-14  1:56 ` jvdelisle at gcc dot gnu dot org
  2008-10-14  3:26 ` jvdelisle at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-10-14  1:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jvdelisle at gcc dot gnu dot org  2008-10-14 01:54 -------
Subject: Bug 37083

Author: jvdelisle
Date: Tue Oct 14 01:53:35 2008
New Revision: 141102

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141102
Log:
2008-10-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org

        PR libfortran/37083
        * gfortran.dg/list_read_9.f90: New test.
        * gfortran.dg/arrayio_8.f90: Fix some typos.

Added:
    trunk/gcc/testsuite/gfortran.dg/list_read_9.f90
Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/arrayio_8.f90


-- 


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


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

* [Bug fortran/37083] Formatted read of line without trailing new-line fails
  2008-08-11 19:53 [Bug fortran/37083] New: See Bug 33400 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33400) tibor at atlas dot cz
                   ` (6 preceding siblings ...)
  2008-10-14  1:56 ` jvdelisle at gcc dot gnu dot org
@ 2008-10-14  3:26 ` jvdelisle at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-10-14  3:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jvdelisle at gcc dot gnu dot org  2008-10-14 03:24 -------
Fixed on trunk.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2008-10-14  3:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-11 19:53 [Bug fortran/37083] New: See Bug 33400 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33400) tibor at atlas dot cz
2008-08-12  0:28 ` [Bug fortran/37083] " jvdelisle at gcc dot gnu dot org
2008-08-17 19:05 ` [Bug fortran/37083] Formatted read of line without trailing new-line fails (Windows; CR-LF issue?) jvdelisle at gcc dot gnu dot org
2008-08-17 19:22 ` [Bug fortran/37083] Formatted read of line without trailing new-line fails burnus at gcc dot gnu dot org
2008-08-17 22:05 ` jvdelisle at gcc dot gnu dot org
2008-10-12 23:28 ` jvdelisle at gcc dot gnu dot org
2008-10-14  1:52 ` jvdelisle at gcc dot gnu dot org
2008-10-14  1:56 ` jvdelisle at gcc dot gnu dot org
2008-10-14  3:26 ` 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).