[gfortran] Fix list directed reads of real number

Steve Kargl sgk@troutmask.apl.washington.edu
Thu Dec 9 06:25:00 GMT 2004


The attached patch fixes a bug in the list directed read of
several values from a single line.  This patch has been
bootstrapped and regression tested on i386-*-FreeBSD6.0.
It actually fixes 4 failures in the testsuite.

                === gfortran Summary ===

# of expected passes            4739
# of unexpected failures        1
# of unexpected successes       8
# of expected failures          18
# of unsupported tests          8

These are the best results I've seen on FreeBSD.  I've also
include a test case for the testsuite.


2004-12-08  Steven G. Kargl  <kargls@comcast.net>

      * io/list_read.c (read_real): Don't return early from function.

-- 
Steve
-------------- next part --------------
Index: list_read.c
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/io/list_read.c,v
retrieving revision 1.11
diff -u -b -r1.11 list_read.c
--- list_read.c	7 Dec 2004 00:00:59 -0000	1.11
+++ list_read.c	9 Dec 2004 06:17:25 -0000
@@ -1000,7 +1000,7 @@
     CASE_SEPARATORS:
       unget_char (c);		/* Single null.  */
       eat_separator ();
-      return;
+      break;
 
     default:
       goto bad_real;
-------------- next part --------------
! { dg-do run }
! Program to test reading in a list of integer values into REAL variables.
! The comma separator was not handled correctly.
!
program fg

  character(len=80) buff

  write (buff,'(a)') '10,20,30,40'
  read(buff,*) a, b, c, d

  if (abs(10. - a) > 1e-5) call abort
  if (abs(20. - b) > 1e-5) call abort
  if (abs(30. - c) > 1e-5) call abort
  if (abs(40. - d) > 1e-5) call abort

end program


More information about the Fortran mailing list