public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/22010] New: Namelists defined in modules not handled properly
@ 2005-06-10 19:53 gcc-bugzilla at chatsubo dot lagged dot za dot net
  2005-06-10 21:10 ` [Bug fortran/22010] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gcc-bugzilla at chatsubo dot lagged dot za dot net @ 2005-06-10 19:53 UTC (permalink / raw)
  To: gcc-bugs

The following code (where input.dat is a file that does not
contain a debugging namelist entry) goes wrong:

MODULE debug
  LOGICAL debug_area
  NAMELIST/debugging/debug_area
END MODULE debug

PROGRAM ding
  USE debug
  IMPLICIT NONE
  INTEGER :: ios
  OPEN(unit=10, status='unknown', file='input.dat')
  READ(unit=10, nml=debugging,  iostat=ios)
  PRINT*, 'nml=debugging',ios
END PROGRAM ding

$ gfortran -o namelistding namelistding.f90 && ./namelistding
 nml=debugging          2

The following works properly:

PROGRAM ding
  IMPLICIT NONE
  LOGICAL debug_area
  NAMELIST/debugging/debug_area
  INTEGER :: ios
  OPEN(unit=10, status='unknown', file='input.dat')
  READ(unit=10, nml=debugging,  iostat=ios)
  PRINT*, 'nml=debugging',ios
END PROGRAM ding

$ gfortran -o namelistding namelistding.f90 && ./namelistding
 nml=debugging          -1

More interesting, the following also works:

MODULE debug
  LOGICAL debug_area
  NAMELIST/debugging/debug_area
END MODULE debug

PROGRAM ding
  USE debug
  IMPLICIT NONE
  NAMELIST/debugging/debug_area
  INTEGER :: ios
  OPEN(unit=10, status='unknown', file='input.dat')
  READ(unit=10, nml=debugging,  iostat=ios)
  PRINT*, 'nml=debugging',ios
END PROGRAM ding

$ gfortran -o namelistding namelistding.f90 && ./namelistding
 nml=debugging          -1

-- 
           Summary: Namelists defined in modules not handled properly
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gcc-bugzilla at chatsubo dot lagged dot za dot net
                CC: gcc-bugs at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-08-05 15:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-10 19:53 [Bug fortran/22010] New: Namelists defined in modules not handled properly gcc-bugzilla at chatsubo dot lagged dot za dot net
2005-06-10 21:10 ` [Bug fortran/22010] " pinskia at gcc dot gnu dot org
2005-06-12 14:33 ` tobi at gcc dot gnu dot org
2005-06-21 21:05 ` pault at gcc dot gnu dot org
2005-08-05  5:32 ` cvs-commit at gcc dot gnu dot org
2005-08-05  5:36 ` pault at gcc dot gnu dot org
2005-08-05 15:50 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).