Error in egcs FORTRAN I/O?
Toon Moene
toon@moene.indiv.nluug.nl
Sat Jan 3 03:44:00 GMT 1998
I asked:
> A complete Fortran program showing the problem would be nice too.
And you replied:
> I would send it, but it is rather large and not that easy
> to build; moreover, it takes probably an hour of runtime
> to get to this problem. This is why I'm suggesting to
> look into the details myself... Or maybe someone have
> encouuntered a similar problem and patch already exists...
Hmm, yeah, I see - that makes my previous questions also rather
unhelpfull, as we can't rerun your program that way.
Perhaps some other remarks and questions can help us out:
1. Is the point at which the error is provoked the first
time through this read statement ?
2. Or is it the first time I/O is done on unit 10 ?
As far as I can see from the libI77 part of the g77 (and f2c)
runtime library, the function that f__doed points to is probably
rd_ed (file rdfmt.c), because you're reading a formatted file using
an `edit string' (I4); it indeed does an fseek (sometimes), and it
returns errno (why n is still 0 is also not clear to me).
However, I don't see why fseek should fail on unit 10. Normally,
unit 10 is either opened by an explicit OPEN statement, or by the
first I/O on that unit (in which case a file with name `fort.10' is
opened). The only way you can get a non-seekable file that way is
having a named pipe `fort.10' before starting your program.
However, at open time it is determined whether the file can be
seeked [sic] (member `useek' of the file unit structure that libI77
uses internally). This member is checked before the seek in rd_ed
is done.
Therefore, I highly suspect one of the underlying components of
your system (libc or the kernel itself) being at fault here.
I am sorry I cannot help you further.
Toon.
More information about the Gcc
mailing list