From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2698 invoked by alias); 6 Mar 2010 09:49:59 -0000 Received: (qmail 2664 invoked by uid 48); 6 Mar 2010 09:49:49 -0000 Date: Sat, 06 Mar 2010 09:49:00 -0000 Message-ID: <20100306094949.2663.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/43265] [4.3/4.4/4.5 Regression] No EOF condition if reading with '(x)' from an empty file In-Reply-To: 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-03/txt/msg00526.txt.bz2 ------- Comment #10 from burnus at gcc dot gnu dot org 2010-03-06 09:49 ------- In terms of the standard, probably everything is OK for I/O: "The set of input/output error conditions is processor dependent." (See "9.11.1 General" for a non-definition when EOF occurs.) Looking at other compilers: * If "X" is the only edit descriptor and there is no marker left in the input buffer (i.e. no '\n'), an End Of File error occurs. (gfortran: No error - this PR) * If one reads, e.g. "i2" from a record where either only a record marker follows or only the end-of-file, one reads the value "0" and no error occurs. (gfortran: No error if record marker follows, but error if only eof follows. Note that reading '(a)' from "a" does not give an error while reading from "" gives an error.) * If one reads "(i2,100x,i2,100x)" or "(100x,2i2)" from a record, one gets two "0" and no error, independent whether the record buffer contains "", "" or " ". (gfortran: If there is a record marker, the result is the same; otherwise an EOF error occurs, unless two integer values could be read - then the trailing "100x" does not cause any error.) I think the result of the other compilers is sensible. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43265