This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug fortran/26766] New: [F2003] Recursive I/O still (again) broken


Hi,

I just checked recursive I/O which was addressed in PR 19352.
It is declared resolved, but still fails with this example:

program gfcbug32
  implicit none
  character (len=4) :: str
  write (str, '(a)')  foo (-1)
  write (*,*) "Test 1:", str
  write (str, '(a)')  foo (1234)
  write (*,*) "Test 2:", str

contains

  function foo (i) result (s)
    integer, intent(in) :: i
    character (len=4)   :: s
    if (i < 0) then
       s = "1234"
    else
       ! Internal I/O, allowed recursive in f2003, see section 9.11
       write (s, '(i4.4)') i
    end if
  end function foo

end program gfcbug32


I get:

At line 6 of file gfcbug32.f90
Fortran runtime error: End of record
 Test 1:1234

Cheers,
-ha


-- 
           Summary: [F2003] Recursive I/O still (again) broken
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: anlauf at gmx dot de
  GCC host triplet: i686-pc-cygwin


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


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