public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/45108]  New: Namelist read: Not aborted when reading from STDIN
@ 2010-07-28 14:50 burnus at gcc dot gnu dot org
  2010-07-28 15:01 ` [Bug fortran/45108] " burnus at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-07-28 14:50 UTC (permalink / raw)
  To: gcc-bugs

gfortran simply continues (with a warning) if one has a wrong namelist in
STDIN.

If one has an IOSTAT variable, it prints the warning but continues with an
IOSTAT == 0.

Using any other means of input (internal unit, external unit) works as
expected, i.e. run-time error - or a non-zero return value for iostat.

Example:

$ gfortran hjff.f90; cat foo.dat|./a.out
Cannot match namelist object name tag3
namelist read: misplaced = sign
 unreachable           0

$ cat foo.dat
&nml tag3=5 /

$ cat hjff.f90
namelist /nml/ tag
character(len=200) str
str ='&nml tg=5 /'
read(*,nml=nml,iostat=ios)
print *, 'unreachable', ios
end

Source code: See line 2964

http://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libgfortran/io/list_read.c;hb=HEAD#l2964


-- 
           Summary: Namelist read: Not aborted when reading from STDIN
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


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

end of thread, other threads:[~2010-08-19 20:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-28 14:50 [Bug fortran/45108] New: Namelist read: Not aborted when reading from STDIN burnus at gcc dot gnu dot org
2010-07-28 15:01 ` [Bug fortran/45108] " burnus at gcc dot gnu dot org
2010-07-28 15:07 ` burnus at gcc dot gnu dot org
2010-07-29  0:59 ` jvdelisle at gcc dot gnu dot org
2010-08-17  3:18 ` jvdelisle at gcc dot gnu dot org
2010-08-17  7:54 ` burnus at gcc dot gnu dot org
2010-08-19  3:52 ` jvdelisle at gcc dot gnu dot org
2010-08-19  9:04 ` burnus at gcc dot gnu dot org
2010-08-19 20:28 ` jvdelisle at gcc dot gnu dot org
2010-08-19 20:33 ` jvdelisle 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).