This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[gfortran] patch PR 20660
- From: FranÃois-Xavier Coudert <Francois-Xavier dot Coudert at lcp dot u-psud dot fr>
- To: gfortran <fortran at gcc dot gnu dot org>, gcc-patches at gcc dot gnu dot org
- Cc: walt at fortran dot com
- Date: Tue, 29 Mar 2005 12:40:20 +0200
- Subject: [gfortran] patch PR 20660
- Organization: Laboratoire de Chimie Physique
The attached trivial patch fixes PR libfortran/20660 (INQUIRE by unit number
reported wrong EXIST value).
Fortran details: if I understand correctly, INQUIREing the EXISTence of a
given unit number should always be TRUE since gfortran can open any
arbitrary unit number.
*strapped and regtested on (i686-linux) for both 4.0 and mainline . OK?
2005-03-29 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/20660
* io/inquire.c (inquire_via_unit): EXIST should always be TRUE.
2005-03-29 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/20660
* gfortran.dg/pr20660.f: New test.
Index: libgfortran/io/inquire.c
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/io/inquire.c,v
retrieving revision 1.9
diff -p -u -r1.9 inquire.c
--- libgfortran/io/inquire.c 30 Jan 2005 13:16:19 -0000 1.9
+++ libgfortran/io/inquire.c 29 Mar 2005 10:33:52 -0000
@@ -46,7 +46,7 @@ inquire_via_unit (gfc_unit * u)
const char *p;
if (ioparm.exist != NULL)
- *ioparm.exist = (u != NULL);
+ *ioparm.exist = 1;
if (ioparm.opened != NULL)
*ioparm.opened = (u != NULL);
! PR libfortran/20660
! {dg-do run}
integer k
logical ck
do k = 1, 20
inquire(unit=k, exist=ck)
if (.not. ck) call abort
end do
end