------- Comment #8 from jvdelisle at gcc dot gnu dot org  2009-04-29 04:06 
-------
Also, we need to consider taking F2003 9.10 at face value.  Notice the use of
the word "attempt":

"An end-of-file condition occurs in the following cases:

(1)  When an endfile record is encountered during the reading of a file
connected for sequential access.

(2) When an attempt is made to read a record beyond the end of an internal
file.

(3) When an attempt is made to read beyond the end of a stream file.

Number (2) seems to clearly apply and has nothing to do with padding.

Still, I want to think about this case:

implicit none
character(len=5) :: str
integer :: a
str = 'mnop '
a = 5
read(str,'(5x,i1)') a
print *, a
if(a /= 0) call abort()
end

I am inclined now to say gfortran is OK based on item (2) since we are clearly
attempting to read the character after the fifth position.  If we change the
length of the string to 6, padding kicks in.


-- 


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

Reply via email to