From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2844 invoked by alias); 11 Jan 2007 17:00:49 -0000 Received: (qmail 2671 invoked by uid 48); 11 Jan 2007 17:00:33 -0000 Date: Thu, 11 Jan 2007 17:00:00 -0000 Message-ID: <20070111170033.2670.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/30435] Slash at end of input not recognized according to standard In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "kargl 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: 2007-01/txt/msg00941.txt.bz2 ------- Comment #1 from kargl at gcc dot gnu dot org 2007-01-11 17:00 ------- The relevant section of the F2003 standard is 10.9.1.1. It appears that in list-directed input that if we advance to a newline during the read and the first item hit is a / when get it wrong. Here a test program. program t integer a, b, c, d ! This works as expected open(unit=10, file='tmp.dat') write(10,*) '1 2 3 / 4' rewind(10) a = -1; b = -1; c = -1; d = -1; read(10,*) a,b,c,d print *, a,b,c,d ! This works as expected rewind(10) write(10,*) '1 2 3 /' rewind(10) a = -2; b = -2; c = -2; d = -2; read(10,*) a,b,c,d print *, a,b,c,d ! This works as expected. rewind(10) write(10,*) '1 2' write(10,*) '3 /' rewind(10) a = -3; b = -3; c = -3; d = -3; read(10,*) a,b,c,d print *, a,b,c,d ! This fails as reported. rewind(10) write(10,*) '1 2 3' write(10,*) '/' rewind(10) a = -4; b = -4; c = -4; d = -4; read(10,*) a,b,c,d print *, a,b,c,d close(unit=10, status='delete') end program t -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30435