When there is a read statement expecting a single entry and a single comma is entered, the read expects more input. The test program is: stuff = 1 stuff2 = 2 write(*,'(1x,a,$)')'Enter 2 somethings: ' read(5,*)stuff,stuff2 write(*,'(1x,a,$)')'Enter something: ' read(5,*)stuff call exit(0) end [ashtray] image 205 % gfortran -o inputbug inputbug.f [ashtray] image 206 % ./inputbug Enter 2 somethings: ,, Enter something: , , / [ashtray] image 207 % It does not accept a , as a default entry for a single number, although two commas work when two numbers are expected. Once it gets one comma it even refuses a / until a second return is entered. This happens on Fedora Core 4 with gcc-gfortran-4.0.2-8.fc4 and on Mac OSX 10.4 with gcc version 4.1.0 20051026 (experimental)
I have a fix for this already. Patch for submottal soon.
Subject: Bug 25419 Author: jvdelisle Date: Wed Dec 28 06:59:35 2005 New Revision: 109099 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109099 Log: 2005-12-28 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/25419 * io/list_read.c (list_formatted_read_scalar): Allow comma to return a null value (default). Modified: trunk/libgfortran/ChangeLog trunk/libgfortran/io/list_read.c
Subject: Bug 25419 Author: jvdelisle Date: Wed Dec 28 07:00:47 2005 New Revision: 109100 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109100 Log: 2005-12-28 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/25419 * gfortran.dg/comma.f: New test. Added: trunk/gcc/testsuite/gfortran.dg/comma.f Modified: trunk/gcc/testsuite/ChangeLog
The patch in comment #2 causes PR25594.
Subject: Bug 25419 Author: jvdelisle Date: Sun Jan 1 02:45:22 2006 New Revision: 109211 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109211 Log: 2005-12-31 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/25594 PR libgfortran/25419 * io/list_read.c (list_formatted_read_scalar): Test for comma to return a null value (default). Revert patch of 25419 on 2005-12-28. Modified: trunk/libgfortran/ChangeLog trunk/libgfortran/io/list_read.c
Subject: Bug 25419 Author: jvdelisle Date: Sun Jan 1 05:04:06 2006 New Revision: 109216 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109216 Log: 2005-12-31 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/25594 PR libgfortran/25419 * io/list_read.c (list_formatted_read_scalar): Test for comma to return a null value (default). Revert patch of 25419 on 2005-12-28. Modified: branches/gcc-4_1-branch/libgfortran/ChangeLog branches/gcc-4_1-branch/libgfortran/io/list_read.c
Subject: Bug 25419 Author: jvdelisle Date: Sun Jan 1 05:06:05 2006 New Revision: 109217 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109217 Log: 2005-12-28 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/25419 * gfortran.dg/comma.f: New test. Added: branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/comma.f Modified: branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
Fixed on 4.1 and 4.2