Hi, when reading a namelist from a file, gfortran does not skip a commented out entry as in !&REPORT use = 'ignore' / ! Commented out, ignore this one! ! &REPORT type = 'SYNOP' use = 'active' max_proc = 20 / The attached program demonstrates that gfortran reads the first entry although it should be skipped.
Created attachment 13087 [details] Read loop for namelist file with multiple entries
Created attachment 13088 [details] The namelist file
Curious. I will exzmine this on the weekend.
Found it. Patch on the way.
Subject: Bug 30918 Author: jvdelisle Date: Sun Feb 25 02:27:17 2007 New Revision: 122307 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122307 Log: 2007-02-24 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/30918 * io/listread.c (namelist_read): Eat comment line. Modified: trunk/libgfortran/ChangeLog trunk/libgfortran/io/list_read.c
Subject: Bug 30918 Author: jvdelisle Date: Sun Feb 25 02:30:14 2007 New Revision: 122308 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122308 Log: 2007-02-24 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/30918 * gfortran.dg/namelist_26.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/namelist_26.f90 Modified: trunk/gcc/testsuite/ChangeLog
Subject: Bug 30918 Author: jvdelisle Date: Sun Feb 25 03:39:19 2007 New Revision: 122309 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122309 Log: 2007-02-24 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/30918 * io/listread.c (namelist_read): Eat comment line. 2007-02-24 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/30918 * gfortran.dg/namelist_26.f90: New test. Added: branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/namelist_26.f90 Modified: branches/gcc-4_2-branch/gcc/testsuite/ChangeLog branches/gcc-4_2-branch/libgfortran/ChangeLog branches/gcc-4_2-branch/libgfortran/io/list_read.c
Subject: Bug 30918 Author: jvdelisle Date: Sun Feb 25 03:52:11 2007 New Revision: 122310 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122310 Log: 2007-02-24 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/30918 * io/listread.c (namelist_read): Eat comment line. 2007-02-24 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/30918 * gfortran.dg/namelist_26.f90: New test. Added: branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/namelist_26.f90 Modified: branches/gcc-4_1-branch/gcc/testsuite/ChangeLog branches/gcc-4_1-branch/libgfortran/ChangeLog branches/gcc-4_1-branch/libgfortran/io/list_read.c
Fixed on 4.3, 4.2, and 4.1 Thanaks Herald for report. Please let me know if you have any other troubles.