Red Hat Bugzilla – Bug 175393
gfotran internal write fails after internal read
Last modified: 2007-11-30 17:11:18 EST
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.
card = '23 45 78'
packtime = '123403.123'
print *,'before write'
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'
print *,'after write'
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Compile above program, gfortran -o readtst readtst.f
2. Run program
Actual Results: [druid] blend 334 % gfortran -o readtst readtst.f
[druid] blend 335 % readtst
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
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.