public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/36657]  New: Namelist reading bug with string constant immediately followed by comment
@ 2008-06-27 20:13 anlauf at gmx dot de
  2008-06-28  1:35 ` [Bug libfortran/36657] " jvdelisle at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: anlauf at gmx dot de @ 2008-06-27 20:13 UTC (permalink / raw)
  To: gcc-bugs

Hi,

the following program shows a runtime bug with gfortran 4.3.x:

% cat gfcbug79.f90 
program gfcbug79
  implicit none

  integer, parameter :: nnml = 10

  character(len=8)  :: model = ""
  namelist /NML/       model

  open (nnml, file='gfcbug79.nml')
  write(nnml,*) "&nml"
  write(nnml,*) "  model='foo'! This is a just comment"
  write(nnml,*) "/"
  rewind(nnml)
  read (nnml, nml=NML)
  close(nnml)
  write (*,nml=NML)
end program gfcbug79
% gfc gfcbug79.f90 && ./a.out 
At line 14 of file gfcbug79.f90 (unit = 10, file = 'gfcbug79.nml')
Fortran runtime error: Invalid string input in item 0
%

Inserting a blank before the comment character ("!")
is a workaround, but gfortran should nevertheless be fixed.

Cheers,
-ha


-- 
           Summary: Namelist reading bug with string constant immediately
                    followed by comment
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: anlauf at gmx dot de
  GCC host triplet: i686-pc-linux-gnu


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


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

end of thread, other threads:[~2008-07-16 14:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-27 20:13 [Bug libfortran/36657] New: Namelist reading bug with string constant immediately followed by comment anlauf at gmx dot de
2008-06-28  1:35 ` [Bug libfortran/36657] " jvdelisle at gcc dot gnu dot org
2008-06-28 21:48 ` jvdelisle at gcc dot gnu dot org
2008-06-28 21:57 ` jvdelisle at gcc dot gnu dot org
2008-07-02  4:45 ` jvdelisle at gcc dot gnu dot org
2008-07-02  4:54 ` jvdelisle at gcc dot gnu dot org
2008-07-02  5:19 ` jvdelisle at gcc dot gnu dot org
2008-07-16 14:25 ` cnstar9988 at gmail dot com
2008-07-16 14:35 ` aldot 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).