This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, libfortran, 3/3] Update file position lazily
- 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: Sat, 29 Oct 2011 00:48:57 +0200
- Subject: Re: [Patch, libfortran, 3/3] Update file position lazily
- References: <CAO9iq9HesLRs6908bMtRRFjVdn6peBk-aZBHHHwpsea43y4G8Q@mail.gmail.com>
On Tuesday 18 October 2011 17:11:24 Janne Blomqvist wrote:
> Also, I think I've found a small standards conformance bug. From F2008
> (N1830) 9.10.2.23 (page 256): "... ASIS if the connection was opened
> without changing its position." and "If the ïle has been repositioned
> since the connection, the scalar-default-char-variable
> is assigned a processor-dependent value, which shall not be REWIND
> unless the ïle is positioned at its initial
> point and shall not be APPEND unless the ïle is positioned so that its
> endïle record is the next record or at its
> terminal point if it has no endïle record.
> "
>
> If my understanding of the above is correct, returning ASIS is
> incorrent unless the position is unchanged since the OPEN statement.
> Currently we return ASIS by default if it's neither REWIND nor APPEND.
> So the patch changes the implementation to return the
> processor-dependent value UNSPECIFIED in this case.
>
If my reading is correct, returning ASIS is as valid as returning UNSPECIFIED
("processor-dependent"). I have a preference for UNSPECIFIED and see your
patch as OK, but shouldn't it be avoided if it breaks backwards compatibility?
I'm also afraid of testsuite changes of the following kind.
Was there no reason for the "-std=legacy"?
diff --git a/gcc/testsuite/gfortran.dg/inquire_5.f90
b/gcc/testsuite/gfortran.dg/inquire_5.f90
index fe107a1..064f96d 100644
--- a/gcc/testsuite/gfortran.dg/inquire_5.f90
+++ b/gcc/testsuite/gfortran.dg/inquire_5.f90
@@ -1,11 +1,10 @@
! { dg-do run { target fd_truncate } }
-! { dg-options "-std=legacy" }
!
Mikael