This is the mail archive of the gcc-patches@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]

Re: [Patch, libfortran, 1/3] Simplify handling of special files


On Tuesday 18 October 2011 16:42:45 Janne Blomqvist wrote:
> Hi,
> 
> in a few places in libgfortran we have some code for handling special
> and/or non-seekable files differently. The problem is that special
> files don't all have some nice consistent behavior. E.g. wrt. seeking,
> some allow seeking just fine, others allow some seeks and not others,
> others allow them but always return an offset of 0, and yet others
> fail the seek completely.
> 
> The Fortran standard doesn't really help here except for noting that
> some files may not be positionable, and thus statements requiring the
> file position to be modified may fail on such files.
> 
> Obviously, libgfortran itself cannot enumerate all the possible
> variations for how a special file may behave, and trying to impose
> some kind of least common denominator may hide essential capability.
> Having thought about this, my conclusion is that the only thing that
> makes sense is that we do what the caller asks us to do, and if that
> fails, we report the error back to the caller and let the caller
> handle it. The attached patch implements this.
> 
> Regtested on x86_64-unknown-linux-gnu, Ok for trunk?
> 
I know little about the library, but your approach looks good, and I have seen 
nothing obviously wrong in the patch.
Thus, as no one else has complained so far: OK.

Mikael


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