From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4265 invoked by alias); 28 Jul 2010 14:50:39 -0000 Received: (qmail 4145 invoked by uid 48); 28 Jul 2010 14:50:08 -0000 Date: Wed, 28 Jul 2010 14:50:00 -0000 Subject: [Bug fortran/45108] New: Namelist read: Not aborted when reading from STDIN X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-07/txt/msg03101.txt.bz2 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