This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, libfortran, 1/3] Simplify handling of special files
- From: Mikael Morin <mikael dot morin at sfr dot fr>
- To: fortran at gcc dot gnu dot org
- Cc: Janne Blomqvist <blomqvist dot janne at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 28 Oct 2011 23:48:06 +0200
- Subject: Re: [Patch, libfortran, 1/3] Simplify handling of special files
- References: <CAO9iq9FxO=NvX=WC6PznUscgoZBnhsZy8sjLzeOzR_-o62E_dQ@mail.gmail.com>
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