From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22936 invoked by alias); 6 Dec 2006 19:26:19 -0000 Received: (qmail 22859 invoked by alias); 6 Dec 2006 19:26:03 -0000 Date: Wed, 06 Dec 2006 19:26:00 -0000 Message-ID: <20061206192603.22858.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libfortran/30009] Unformatted reads exceeding storage units gives EOF instead of ERR In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "tkoenig 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: 2006-12/txt/msg00516.txt.bz2 ------- Comment #13 from tkoenig at gcc dot gnu dot org 2006-12-06 19:26 ------- Subject: Bug 30009 Author: tkoenig Date: Wed Dec 6 19:25:44 2006 New Revision: 119592 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119592 Log: 2006-12-06 Thomas Koenig PR libfortran/30009 PR libfortran/30056 * gfortran.dg/read_eof_4.f90: Add tests. * gfortran.dg/readwrite_unf_direct_eor_1.f90: New test. * gfortran.dg/unf_read_corrupted_1.f90: New test. 2006-12-06 Thomas Koenig PR libfortran/30009 PR libfortran/30056 * libgfortran.h: Add ERROR_CORRUPT_FILE to error_codes. * runtime/error.c (translate_error): Add handling for ERROR_CORRUPT_FILE. * io/transfer.c (read_block_direct): Add comment about EOR for stream files. Remove test for no bytes left for direct access files. Generate an ERROR_SHORT_RECORD if the read was short. For unformatted sequential files: Check endfile condition. Remove test for no bytes left. End of file here means that the file structure has been corrupted. Pre-position the file for the next record in case of error. (write_buf): Whitespace fix. Subtract the number of bytes written from bytes_left. Added: trunk/gcc/testsuite/gfortran.dg/readwrite_unf_direct_eor_1.f90 trunk/gcc/testsuite/gfortran.dg/unf_read_corrupted_1.f90 Modified: trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gfortran.dg/read_eof_4.f90 trunk/libgfortran/ChangeLog trunk/libgfortran/io/transfer.c trunk/libgfortran/libgfortran.h trunk/libgfortran/runtime/error.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30009