From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc4 Firefox/1.0.7 Description of problem: After an internal read from a character string just big enough to hold a number, an internal write to a longer format gives an End of record error. character*80 card real*4 xnum character*9 tim character*10 packtime c card = '23 45 78' packtime = '123403.123' print *,'before write' write(tim,101)packtime(1:2) 101 format(a2,'-') ! It runs if format is just a2 read(card(1:2),*)XNUM ! It runs if longer string than 1:2 is given print *,'after read' write(tim,101)packtime(1:2) print *,'after write' call exit(0) end Version-Release number of selected component (if applicable): gcc-gfortran-4.0.2-8.fc4 How reproducible: Always Steps to Reproduce: 1. Compile above program, gfortran -o readtst readtst.f 2. Run program 3. Actual Results: [druid] blend 334 % gfortran -o readtst readtst.f [druid] blend 335 % readtst before write after read At line 13 of file readtst.f Fortran runtime error: End of record Expected Results: [druid] blend 336 % g77 -o readtst readtst.f [druid] blend 337 % readtst before write after read after write Additional info: This does not fail on Mac OSX 10.4 with: gcc version 4.1.0 20051026 (experimental) So maybe it is fixed already, or maybe it is system dependent
Works just fine in gcc-gfortran-4.1.0-0.6 (in Fedora development). There are several fixes that haven't been applied to 4.0.x and probably aren't going to be.