[libgfortran, patch] PR 19595, eor does not work

Thomas Koenig Thomas.Koenig@online.de
Wed Jan 26 21:45:00 GMT 2005


This was bubblestrapped and regtested on i686-pc-linux-gnu.

This fixes the advance="NO" case for eor in the case where
no eor actually happens.  The other part of the bug is
still open, but it's impossible to get there unless
this gets fixed first.

Ok?

	Thomas

2005-01-26  Thomas Koenig <Thomas.Koenig@online.de>

	PR libfortran/19595
	* io/transfer.c (data_transfer_init):  eor requires
	advance="NO"

	PR libfortran/19595
	* eor_1.f90:  New testcase
-------------- next part --------------
Index: transfer.c
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/io/transfer.c,v
retrieving revision 1.30
diff -c -r1.30 transfer.c
*** transfer.c	23 Jan 2005 17:16:43 -0000	1.30
--- transfer.c	26 Jan 2005 21:18:46 -0000
***************
*** 1041,1047 ****
  
    if (read_flag)
      {
!       if (ioparm.eor != 0 && advance_status == ADVANCE_NO)
  	generate_error (ERROR_MISSING_OPTION,
  			"EOR specification requires an ADVANCE specification of NO");
  
--- 1041,1047 ----
  
    if (read_flag)
      {
!       if (ioparm.eor != 0 && advance_status != ADVANCE_NO)
  	generate_error (ERROR_MISSING_OPTION,
  			"EOR specification requires an ADVANCE specification of NO");
  
-------------- next part --------------
! { dg do-run }
! PR 19451: The test for advance='NO' with eor used
!           to be reversed.
program main
  character*2 c
  open(12)
  write(12,'(A)') '123','456'
  rewind(12)
  read(12,'(A2)',advance='NO',eor=100) c
100 continue
end program main


More information about the Fortran mailing list