Bug 30918 - Failure to skip commented out NAMELIST
Summary: Failure to skip commented out NAMELIST
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libfortran (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Jerry DeLisle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-21 21:45 UTC by Harald Anlauf
Modified: 2007-02-25 04:00 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-02-25 00:28:37


Attachments
Read loop for namelist file with multiple entries (391 bytes, text/plain)
2007-02-21 21:47 UTC, Harald Anlauf
Details
The namelist file (134 bytes, text/plain)
2007-02-21 21:47 UTC, Harald Anlauf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Anlauf 2007-02-21 21:45:50 UTC
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.
Comment 1 Harald Anlauf 2007-02-21 21:47:00 UTC
Created attachment 13087 [details]
Read loop for namelist file with multiple entries
Comment 2 Harald Anlauf 2007-02-21 21:47:52 UTC
Created attachment 13088 [details]
The namelist file
Comment 3 Jerry DeLisle 2007-02-22 01:23:51 UTC
Curious. I will exzmine this on the weekend.
Comment 4 Jerry DeLisle 2007-02-25 00:28:37 UTC
Found it.  Patch on the way.
Comment 5 Jerry DeLisle 2007-02-25 02:27:27 UTC
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

Comment 6 Jerry DeLisle 2007-02-25 02:30:23 UTC
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

Comment 7 Jerry DeLisle 2007-02-25 03:39:30 UTC
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

Comment 8 Jerry DeLisle 2007-02-25 03:52:20 UTC
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

Comment 9 Jerry DeLisle 2007-02-25 04:00:03 UTC
Fixed on 4.3, 4.2, and 4.1
Thanaks Herald for report.  Please let me know if you have any other troubles.