This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

[gfortran] patch for pr19313, INQUIRE(..pad=..)


"pad=" was not implemented all the way.

below patch tested i686/gnu-linux with no additional regressions.
no change to NIST F77 testsuite.

the test file below fails before and passes after the patch is applied.


--bud


2004-01-17  Bud Davis  <bdavis9659@comcast.net>

	PR fortran/19313
	* trans-io.c (gfc_trans_inquire): Added code to support
	pad.

Index: gcc/gcc/fortran/trans-io.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-io.c,v
retrieving revision 1.25
diff -c -3 -p -r1.25 trans-io.c
*** gcc/gcc/fortran/trans-io.c	3 Jan 2005 21:43:55 -0000	1.25
--- gcc/gcc/fortran/trans-io.c	18 Jan 2005 02:26:50 -0000
*************** gfc_trans_inquire (gfc_code * code)
*** 798,803 ****
--- 798,807 ----
      set_string (&block, &post_block, ioparm_delim, ioparm_delim_len,
  		p->delim);
  
+   if (p->pad)
+     set_string (&block, &post_block, ioparm_pad, ioparm_pad_len,
+                 p->pad); 
+ 
    if (p->err)
      set_flag (&block, ioparm_err);
  
!pr19313 - inquire(..pad=..)
      implicit none
      logical debug
      data debug /.TRUE./
      character*20 chr
      chr=''
!  not connected 
      inquire(7,pad=chr)
      if (debug) print*,chr
      if (chr.ne.'UNDEFINED') call abort
      chr=''
!  not a formatted file
      open(7,FORM='UNFORMATTED',STATUS='SCRATCH')
      inquire(7,pad=chr)
      if (debug) print*,chr
      if (chr.ne.'UNDEFINED') call abort
      chr=''
! yes
      open(8,STATUS='SCRATCH',PAD='YES')
      inquire(8,pad=chr)
      if (debug) print*,chr
      if (chr.ne.'YES') call abort
      chr=''
! no
      open(9,STATUS='SCRATCH',PAD='NO')
      inquire(9,pad=chr)
      if (debug) print*,chr
      if (chr.ne.'NO') call abort
      chr=''
      end



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