This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gfortran] Patch for PR 14831 - INQUIRE specifiers return wrongvalues
- From: Bud Davis <bdavis9659 at comcast dot net>
- To: gfortran <fortran at gcc dot gnu dot org>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 02 Apr 2004 21:36:02 -0600
- Subject: [gfortran] Patch for PR 14831 - INQUIRE specifiers return wrongvalues
Fixes PR 14831 and NIST tests FM914.FOR FM915.FOR FM916.FOR.
Wrong string for BLANK=NULL, wrong variable for ACTION.
No additional test suite failures, tested i686/gnu/linux.
--bud
Fortran 95 (!) source file test:
! PR 14831
CHARACTER*4 BLANK
CHARACTER*10 ACCESS
OPEN(UNIT=9,ACCESS='SEQUENTIAL')
INQUIRE(UNIT=9,ACCESS=ACCESS,BLANK=BLANK)
IF(BLANK.NE.'NULL') CALL ABORT
IF(ACCESS.NE.'SEQUENTIAL') CALL ABORT
END
2004-04-02 Bud Davis <bdavis9659@comcast.net>
PR 14831
io/inquire.c (inquire_via_unit) : Changed return string for
BLANK=NULL. Use correct variable for ACTION.
Index: gcc/libgfortran/io/inquire.c
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/io/Attic/inquire.c,v
retrieving revision 1.1.2.3
diff -c -3 -p -r1.1.2.3 inquire.c
*** gcc/libgfortran/io/inquire.c 19 Sep 2003 19:11:12 -0000 1.1.2.3
--- gcc/libgfortran/io/inquire.c 3 Apr 2004 03:30:32 -0000
*************** inquire_via_unit (unit_t * u)
*** 137,143 ****
switch (u->flags.blank)
{
case BLANK_NULL:
! p = "BLANK";
break;
case BLANK_ZERO:
p = "ZERO";
--- 137,143 ----
switch (u->flags.blank)
{
case BLANK_NULL:
! p = "NULL";
break;
case BLANK_ZERO:
p = "ZERO";
*************** inquire_via_unit (unit_t * u)
*** 161,167 ****
cf_strcpy (ioparm.blank, ioparm.blank_len, p);
}
! if (ioparm.access != NULL)
{
if (u == NULL)
p = undefined;
--- 161,167 ----
cf_strcpy (ioparm.blank, ioparm.blank_len, p);
}
! if (ioparm.action != NULL)
{
if (u == NULL)
p = undefined;
*************** inquire_via_unit (unit_t * u)
*** 181,187 ****
internal_error ("inquire_via_unit(): Bad action");
}
! cf_strcpy (ioparm.access, ioparm.access_len, p);
}
if (ioparm.read != NULL)
--- 181,187 ----
internal_error ("inquire_via_unit(): Bad action");
}
! cf_strcpy (ioparm.action, ioparm.action_len, p);
}
if (ioparm.read != NULL)