gfortran falsely accepts a namelist in a block
data:

$ cat block_d.f
      block data
      common /foo/ a
      namelist /foo_n/ a
      data a /1.0/
      end
$ gfortran -S block_d.f
$ gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.1/configure --prefix=/home/ig25 
--enable-languages=c,f95
Thread model: posix
gcc version 4.1.0 20050508 (experimental)

g77 correctly rejects it, although with a confusing error message:

$ g77 -S block_d.f
block_d.f: In block-data unit `_BLOCK_DATA__':
block_d.f:2:
         common /foo/ a
         1
block_d.f:3: (continued):
         namelist /foo_n/ a
         2
Statement at (2) invalid in context established by statement at (1)

-- 
           Summary: namelist in block data is illegal
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid, diagnostic
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21565

Reply via email to